summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorRobert Speicher <robert@gitlab.com>2017-04-14 00:45:55 +0000
committerRobert Speicher <robert@gitlab.com>2017-04-14 00:45:55 +0000
commit0497d3eadb67f347a6376c77cbd39511e5136bfb (patch)
tree185478dc11d29253b85058ece977a31f43ea998f /spec
parent0e15e432adfd74576977c8abd5cf5cdffc02102a (diff)
parent460fb1fabab8f9afd364055e9d9b212dbb7f8c82 (diff)
downloadgitlab-ce-0497d3eadb67f347a6376c77cbd39511e5136bfb.tar.gz
Merge branch 'sh-improve-logging-for-bad-creations' into 'master'
Improve error messages when a record is unable to be created for a project See merge request !10696
Diffstat (limited to 'spec')
-rw-r--r--spec/services/projects/create_service_spec.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/services/projects/create_service_spec.rb b/spec/services/projects/create_service_spec.rb
index 62f21049b0b..7a07ea618c0 100644
--- a/spec/services/projects/create_service_spec.rb
+++ b/spec/services/projects/create_service_spec.rb
@@ -144,6 +144,20 @@ describe Projects::CreateService, '#execute', services: true do
end
end
+ context 'when a bad service template is created' do
+ before do
+ create(:service, type: 'DroneCiService', project: nil, template: true, active: true)
+ end
+
+ it 'reports an error in the imported project' do
+ opts[:import_url] = 'http://www.gitlab.com/gitlab-org/gitlab-ce'
+ project = create_project(user, opts)
+
+ 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
+ end
+ end
+
def create_project(user, opts)
Projects::CreateService.new(user, opts).execute
end