diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-03-28 18:56:17 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-03-28 18:56:17 +0300 |
commit | bc2eff8dfb8d90b852ae69b59831e557322caeb8 (patch) | |
tree | cf343fb36051472b950a409b1e90e4d00bfaa577 /spec/services/projects | |
parent | 5ac5767e05474a0dfe37b6a0a619948bd91fccd8 (diff) | |
parent | 7fd9e39d885c7d7520ba0a7e45e8c58847f1c11d (diff) |
Merge branch '44392-resolve-projects-creation-silently-failing-on-after-create-error' into 'master'
Resolve "For new created projects permissions are not inherited from group level"
Closes #44692
See merge request gitlab-org/gitlab-ce!18013
Diffstat (limited to 'spec/services/projects')
-rw-r--r-- | spec/services/projects/create_service_spec.rb | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 4413c6ef83e..2cacb97a293 100644 --- a/spec/services/projects/create_service_spec.rb +++ b/spec/services/projects/create_service_spec.rb @@ -70,6 +70,16 @@ describe Projects::CreateService, '#execute' do opts[:default_branch] = 'master' expect(create_project(user, opts)).to eq(nil) end + + it 'sets invalid service as inactive' do + create(:service, type: 'JiraService', project: nil, template: true, active: true) + + project = create_project(user, opts) + service = project.services.first + + expect(project).to be_persisted + expect(service.active).to be false + end end context 'wiki_enabled creates repository directory' do @@ -232,14 +242,15 @@ describe Projects::CreateService, '#execute' do end context 'when a bad service template is created' do - it 'reports an error in the imported project' do + it 'sets service to be inactive' do opts[:import_url] = 'http://www.gitlab.com/gitlab-org/gitlab-ce' create(:service, type: 'DroneCiService', project: nil, template: true, active: true) project = create_project(user, opts) + service = project.services.first - expect(project.errors.full_messages_for(:base).first).to match(/Unable to save project. Error: Unable to save DroneCiService/) - expect(project.services.count).to eq 0 + expect(project).to be_persisted + expect(service.active).to be false end end |