summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorValery Sizov <valery@gitlab.com>2016-07-04 20:04:29 +0300
committerValery Sizov <valery@gitlab.com>2016-07-04 20:16:55 +0300
commit926a8ab4765fe9249bfb54926ef8efa3ee78fd16 (patch)
tree50264f13568e31452ed3705f5cf0f1f509f3b032 /spec/services
parentf60b48bdcb4762451618fe03bca98581282a0904 (diff)
downloadgitlab-ce-926a8ab4765fe9249bfb54926ef8efa3ee78fd16.tar.gz
Handle custom Git hook result in GitLab UI
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/merge_requests/merge_service_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/services/merge_requests/merge_service_spec.rb b/spec/services/merge_requests/merge_service_spec.rb
index 1b0396eb686..2f72cd60071 100644
--- a/spec/services/merge_requests/merge_service_spec.rb
+++ b/spec/services/merge_requests/merge_service_spec.rb
@@ -65,6 +65,16 @@ describe MergeRequests::MergeService, services: true do
expect(merge_request.merge_error).to eq("Something went wrong during merge")
end
+
+ it 'saves error if there is an PreReceiveError exception' do
+ allow(service).to receive(:repository).and_raise(GitHooksService::PreReceiveError, "error")
+
+ allow(service).to receive(:execute_hooks)
+
+ service.execute(merge_request)
+
+ expect(merge_request.merge_error).to eq("error")
+ end
end
end
end