diff options
author | Valery Sizov <valery@gitlab.com> | 2016-07-04 20:04:29 +0300 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-07-04 20:16:55 +0300 |
commit | 926a8ab4765fe9249bfb54926ef8efa3ee78fd16 (patch) | |
tree | 50264f13568e31452ed3705f5cf0f1f509f3b032 /spec/services | |
parent | f60b48bdcb4762451618fe03bca98581282a0904 (diff) |
Handle custom Git hook result in GitLab UI
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/merge_requests/merge_service_spec.rb | 10 |
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 |