diff options
author | Arthur Gautier <baloo@gandi.net> | 2015-02-26 09:17:25 +0100 |
---|---|---|
committer | Arthur Gautier <baloo@gandi.net> | 2015-05-13 09:33:20 +0200 |
commit | a927bf56b16c10bafc5bd9a14d034d2898b45c8e (patch) | |
tree | 12decb137680ab1158b110d5f281c2e62939bacf /spec/services | |
parent | 8b9e3af8bf7a6089a11ef3f5eb91dfef4940a3f4 (diff) | |
download | gitlab-ce-a927bf56b16c10bafc5bd9a14d034d2898b45c8e.tar.gz |
Call merge request web hook for each commits
Call merge request web hook every times a new commit hits the
source branch
Signed-off-by: Arthur Gautier <baloo@gandi.net>
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/merge_requests/refresh_service_spec.rb | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/services/merge_requests/refresh_service_spec.rb b/spec/services/merge_requests/refresh_service_spec.rb index 879df0c9c67..0f9b65678df 100644 --- a/spec/services/merge_requests/refresh_service_spec.rb +++ b/spec/services/merge_requests/refresh_service_spec.rb @@ -30,11 +30,18 @@ describe MergeRequests::RefreshService do end context 'push to origin repo source branch' do + let(:refresh_service) { service.new(@project, @user) } before do - service.new(@project, @user).execute(@oldrev, @newrev, 'refs/heads/master') + allow(refresh_service).to receive(:execute_hooks) + refresh_service.execute(@oldrev, @newrev, 'refs/heads/master') reload_mrs end + it 'should execute hooks with update action' do + expect(refresh_service).to have_received(:execute_hooks). + with(@merge_request, 'update') + end + it { expect(@merge_request.notes).not_to be_empty } it { expect(@merge_request).to be_open } it { expect(@fork_merge_request).to be_open } @@ -54,11 +61,18 @@ describe MergeRequests::RefreshService do end context 'push to fork repo source branch' do + let(:refresh_service) { service.new(@fork_project, @user) } before do - service.new(@fork_project, @user).execute(@oldrev, @newrev, 'refs/heads/master') + allow(refresh_service).to receive(:execute_hooks) + refresh_service.execute(@oldrev, @newrev, 'refs/heads/master') reload_mrs end + it 'should execute hooks with update action' do + expect(refresh_service).to have_received(:execute_hooks). + with(@fork_merge_request, 'update') + end + it { expect(@merge_request.notes).to be_empty } it { expect(@merge_request).to be_open } it { expect(@fork_merge_request.notes.last.note).to include('Added 4 commits') } |