diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2018-04-19 18:24:32 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-04-19 18:24:32 +0300 |
commit | 92deabb34ae20a2a10f70c2de316f8f235f08e49 (patch) | |
tree | d82a3761fd303428cd53cb04512f93af61d929a6 /spec/services/projects | |
parent | 6c868a01901e769759b0bfc6801bc2d3c988bf01 (diff) |
Respect visibility options and description when importing project from template
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/create_from_template_service_spec.rb | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/spec/services/projects/create_from_template_service_spec.rb b/spec/services/projects/create_from_template_service_spec.rb index 609d678caea..d40e6f1449d 100644 --- a/spec/services/projects/create_from_template_service_spec.rb +++ b/spec/services/projects/create_from_template_service_spec.rb @@ -7,7 +7,7 @@ describe Projects::CreateFromTemplateService do path: user.to_param, template_name: 'rails', description: 'project description', - visibility_level: Gitlab::VisibilityLevel::PRIVATE + visibility_level: Gitlab::VisibilityLevel::PUBLIC } end @@ -24,7 +24,23 @@ describe Projects::CreateFromTemplateService do expect(project).to be_saved expect(project.scheduled?).to be(true) - expect(project.description).to match('project description') - expect(project.visibility_level).to eq(Gitlab::VisibilityLevel::PRIVATE) + end + + context 'the result project' do + before do + Sidekiq::Testing.inline! do + @project = subject.execute + end + + @project.reload + end + + it 'overrides template description' do + expect(@project.description).to match('project description') + end + + it 'overrides template visibility_level' do + expect(@project.visibility_level).to eq(Gitlab::VisibilityLevel::PUBLIC) + end end end |