summaryrefslogtreecommitdiff
path: root/spec/support
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-05-25 15:14:16 +0000
committerRobert Speicher <robert@gitlab.com>2017-05-25 15:14:16 +0000
commit516e3532c68fb8f40fee083039e711cd6bb8c78c (patch)
tree8aa163411ef184bccb332b7f4622178f4f1acfdd /spec/support
parent6a88f187be67b8396a23f9b458a2718845af8e5e (diff)
parentc27877cab540f51e9932d6f786e8c39bc4260594 (diff)
downloadgitlab-ce-516e3532c68fb8f40fee083039e711cd6bb8c78c.tar.gz
Merge branch 'revert-b0498c17' into 'master'
Refactor `DynamicPathValidator` and `GitLab::Regex` some more See merge request !11693
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/controllers/githubish_import_controller_shared_examples.rb16
1 files changed, 12 insertions, 4 deletions
diff --git a/spec/support/controllers/githubish_import_controller_shared_examples.rb b/spec/support/controllers/githubish_import_controller_shared_examples.rb
index c59b30c772d..d6b40db09ce 100644
--- a/spec/support/controllers/githubish_import_controller_shared_examples.rb
+++ b/spec/support/controllers/githubish_import_controller_shared_examples.rb
@@ -209,9 +209,13 @@ shared_examples 'a GitHub-ish import controller: POST create' do
end
context 'user has chosen a namespace and name for the project' do
- let(:test_namespace) { create(:namespace, name: 'test_namespace', owner: user) }
+ let(:test_namespace) { create(:group, name: 'test_namespace') }
let(:test_name) { 'test_name' }
+ before do
+ test_namespace.add_owner(user)
+ end
+
it 'takes the selected namespace and name' do
expect(Gitlab::GithubImport::ProjectCreator).
to receive(:new).with(provider_repo, test_name, test_namespace, user, access_params, type: provider).
@@ -230,10 +234,14 @@ shared_examples 'a GitHub-ish import controller: POST create' do
end
context 'user has chosen an existing nested namespace and name for the project' do
- let(:parent_namespace) { create(:namespace, name: 'foo', owner: user) }
- let(:nested_namespace) { create(:namespace, name: 'bar', parent: parent_namespace, owner: user) }
+ let(:parent_namespace) { create(:group, name: 'foo', owner: user) }
+ let(:nested_namespace) { create(:group, name: 'bar', parent: parent_namespace) }
let(:test_name) { 'test_name' }
+ before do
+ nested_namespace.add_owner(user)
+ end
+
it 'takes the selected namespace and name' do
expect(Gitlab::GithubImport::ProjectCreator).
to receive(:new).with(provider_repo, test_name, nested_namespace, user, access_params, type: provider).
@@ -276,7 +284,7 @@ shared_examples 'a GitHub-ish import controller: POST create' do
context 'user has chosen existent and non-existent nested namespaces and name for the project' do
let(:test_name) { 'test_name' }
- let!(:parent_namespace) { create(:namespace, name: 'foo', owner: user) }
+ let!(:parent_namespace) { create(:group, name: 'foo', owner: user) }
it 'takes the selected namespace and name' do
expect(Gitlab::GithubImport::ProjectCreator).