diff options
author | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-03-27 10:28:04 +0100 |
---|---|---|
committer | Tiago Botelho <tiagonbotelho@hotmail.com> | 2018-03-27 16:13:42 +0100 |
commit | bf4a3af06ac4cb7f321267bf395022420e0c14a2 (patch) | |
tree | 793fecb88f34aa8d56f0c7677b4bff5ff697bbfb /spec/services | |
parent | c628f8f42651a74462eddd71ab53bd1784f9a8bf (diff) | |
download | gitlab-ce-bf4a3af06ac4cb7f321267bf395022420e0c14a2.tar.gz |
Project creation does not fail silently on DB related changes
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/projects/create_service_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb index 8471467d2fa..fbaa4f7aebc 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 'handles invalid service' do + create(:service, type: 'JiraService', project: nil, template: true, active: true) + + project = create_project(user, opts) + + expect(project).not_to be_persisted + expect(project.errors.full_messages_for(:base).first).to match(/Unable to save project. Error: Unable to save JiraService/) + expect(project.services.count).to eq 0 + end end context 'wiki_enabled creates repository directory' do |