diff options
author | jubianchi <contact@jubianchi.fr> | 2015-01-18 03:34:34 +0300 |
---|---|---|
committer | jubianchi <contact@jubianchi.fr> | 2015-01-20 12:50:24 +0300 |
commit | 4ffdb83e713b1ffa9578c02d31cfd0d9afe56ca7 (patch) | |
tree | c1277e89d305685e1d78b71067a8708d94e1c6fe /spec/services/merge_requests/close_service_spec.rb | |
parent | b1c79eaf945b22602552edf8d111c5245057bad2 (diff) |
Add action property to merge request hook
Diffstat (limited to 'spec/services/merge_requests/close_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/close_service_spec.rb | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/spec/services/merge_requests/close_service_spec.rb b/spec/services/merge_requests/close_service_spec.rb index a504f916b08..5060a67bebf 100644 --- a/spec/services/merge_requests/close_service_spec.rb +++ b/spec/services/merge_requests/close_service_spec.rb @@ -12,14 +12,23 @@ describe MergeRequests::CloseService do end describe :execute do - context "valid params" do + context 'valid params' do + let(:service) { MergeRequests::CloseService.new(project, user, {}) } + before do - @merge_request = MergeRequests::CloseService.new(project, user, {}).execute(merge_request) + service.stub(:execute_hooks) + + @merge_request = service.execute(merge_request) end it { @merge_request.should be_valid } it { @merge_request.should be_closed } + it 'should execute hooks with close action' do + expect(service).to have_received(:execute_hooks). + with(@merge_request, 'close') + end + it 'should send email to user2 about assign of new merge_request' do email = ActionMailer::Base.deliveries.last email.to.first.should == user2.email @@ -28,7 +37,7 @@ describe MergeRequests::CloseService do it 'should create system note about merge_request reassign' do note = @merge_request.notes.last - note.note.should include "Status changed to closed" + note.note.should include 'Status changed to closed' end end end |