diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2017-03-31 00:24:49 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-03-31 00:24:49 +0300 |
commit | 9bac3bfc587466a42194350ae51d2e9ad74a7627 (patch) | |
tree | 9968950dcff45522d586a8e1d3197f6ba7f2e19d /spec/support/controllers | |
parent | 6ff5e7f798e13a94666336ca51211d31bdd2a4b5 (diff) |
Allow users to import GitHub projects to subgroups
Diffstat (limited to 'spec/support/controllers')
-rw-r--r-- | spec/support/controllers/githubish_import_controller_shared_examples.rb | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/support/controllers/githubish_import_controller_shared_examples.rb b/spec/support/controllers/githubish_import_controller_shared_examples.rb index d0fd2d52004..51f1015f43c 100644 --- a/spec/support/controllers/githubish_import_controller_shared_examples.rb +++ b/spec/support/controllers/githubish_import_controller_shared_examples.rb @@ -228,5 +228,19 @@ shared_examples 'a GitHub-ish import controller: POST create' do post :create, { new_name: test_name, format: :js } end end + + context 'user has chosen a 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(:test_name) { 'test_name' } + + 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). + and_return(double(execute: true)) + + post :create, { target_namespace: nested_namespace.full_path, new_name: test_name, format: :js } + end + end end end |