diff options
Diffstat (limited to 'spec/services/git_push_service_spec.rb')
-rw-r--r-- | spec/services/git_push_service_spec.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/services/git_push_service_spec.rb b/spec/services/git_push_service_spec.rb index d4528256640..45ef26aebbd 100644 --- a/spec/services/git_push_service_spec.rb +++ b/spec/services/git_push_service_spec.rb @@ -246,13 +246,15 @@ describe GitPushService, services: true do describe 'system hooks' do let!(:push_data) { push_data_from_service(project, user, oldrev, newrev, ref) } - let(:system_hooks_service) { SystemHooksService.new } + let!(:system_hooks_service) { SystemHooksService.new } it "sends a system hook after pushing a branch" do - expect(SystemHooksService).to receive(:new).and_return(system_hooks_service) - expect(system_hooks_service).to receive(:execute_hooks).with(push_data, :push_hooks) + allow(SystemHooksService).to receive(:new).and_return(system_hooks_service) + allow(system_hooks_service).to receive(:execute_hooks) execute_service(project, user, oldrev, newrev, ref) + + expect(system_hooks_service).to have_received(:execute_hooks).with(push_data, :push_hooks) end end end |