diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-09-07 16:15:32 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-09-07 16:15:32 +0000 |
commit | 523a1c69ab6c51969f2613c4042d91318f841081 (patch) | |
tree | a30cd8e62725a818a9d0e4bfa6405fe194fdc3d6 /spec/support | |
parent | ec304cb9297ae75a7f46d6945d537c5d1cbd2fdf (diff) | |
parent | cfd475a45ee2655fa0148b0b561f95b44fe8641b (diff) | |
download | gitlab-ce-523a1c69ab6c51969f2613c4042d91318f841081.tar.gz |
Merge branch '23079-remove-default-scope-in-sortable' into 'master'
Removes default scope from sortable
Closes #23079
See merge request !13558
Diffstat (limited to 'spec/support')
-rw-r--r-- | spec/support/controllers/githubish_import_controller_shared_examples.rb | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/spec/support/controllers/githubish_import_controller_shared_examples.rb b/spec/support/controllers/githubish_import_controller_shared_examples.rb index 4eec3127464..b23d81a226a 100644 --- a/spec/support/controllers/githubish_import_controller_shared_examples.rb +++ b/spec/support/controllers/githubish_import_controller_shared_examples.rb @@ -140,9 +140,14 @@ shared_examples 'a GitHub-ish import controller: POST create' do end context "when a namespace with the provider user's username already exists" do - let!(:existing_namespace) { create(:namespace, name: other_username, owner: user) } + let!(:existing_namespace) { user.namespace } context "when the namespace is owned by the GitLab user" do + before do + user.username = other_username + user.save + end + it "takes the existing namespace" do expect(Gitlab::GithubImport::ProjectCreator) .to receive(:new).with(provider_repo, provider_repo.name, existing_namespace, user, access_params, type: provider) @@ -153,12 +158,9 @@ shared_examples 'a GitHub-ish import controller: POST create' do end context "when the namespace is not owned by the GitLab user" do - before do - existing_namespace.owner = create(:user) - existing_namespace.save - end - it "creates a project using user's namespace" do + create(:user, username: other_username) + expect(Gitlab::GithubImport::ProjectCreator) .to receive(:new).with(provider_repo, provider_repo.name, user.namespace, user, access_params, type: provider) .and_return(double(execute: true)) |