diff options
author | jubianchi <contact@jubianchi.fr> | 2015-01-18 01:34:34 +0100 |
---|---|---|
committer | jubianchi <contact@jubianchi.fr> | 2015-01-20 10:50:24 +0100 |
commit | 4ffdb83e713b1ffa9578c02d31cfd0d9afe56ca7 (patch) | |
tree | c1277e89d305685e1d78b71067a8708d94e1c6fe /spec/services/merge_requests/create_service_spec.rb | |
parent | b1c79eaf945b22602552edf8d111c5245057bad2 (diff) | |
download | gitlab-ce-4ffdb83e713b1ffa9578c02d31cfd0d9afe56ca7.tar.gz |
Add action property to merge request hook
Diffstat (limited to 'spec/services/merge_requests/create_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/create_service_spec.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/spec/services/merge_requests/create_service_spec.rb b/spec/services/merge_requests/create_service_spec.rb index cebeb0644d0..dbd21143690 100644 --- a/spec/services/merge_requests/create_service_spec.rb +++ b/spec/services/merge_requests/create_service_spec.rb @@ -5,21 +5,30 @@ describe MergeRequests::CreateService do let(:user) { create(:user) } describe :execute do - context "valid params" do - before do - project.team << [user, :master] - opts = { + context 'valid params' do + let(:opts) do + { title: 'Awesome merge_request', description: 'please fix', source_branch: 'stable', target_branch: 'master' } + end + let(:service) { MergeRequests::CreateService.new(project, user, opts) } + + before do + project.team << [user, :master] + service.stub(:execute_hooks) - @merge_request = MergeRequests::CreateService.new(project, user, opts).execute + @merge_request = service.execute end it { @merge_request.should be_valid } it { @merge_request.title.should == 'Awesome merge_request' } + + it 'should execute hooks with default action' do + expect(service).to have_received(:execute_hooks).with(@merge_request) + end end end end |