diff options
author | Nikita Verkhovin <vernik91@gmail.com> | 2015-02-07 14:14:55 +0300 |
---|---|---|
committer | Nikita Verkhovin <vernik91@gmail.com> | 2015-02-08 19:35:41 +0300 |
commit | 8681cb3137511e51e19f76aef9839be28f8fcd6a (patch) | |
tree | f2d5a929763d77b12c4248cc1bb50a01766bcbfe /spec/services/merge_requests/update_service_spec.rb | |
parent | 0a34f2dcb562098c481140246f7ac22683b38d76 (diff) |
Add labels notes
Diffstat (limited to 'spec/services/merge_requests/update_service_spec.rb')
-rw-r--r-- | spec/services/merge_requests/update_service_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/services/merge_requests/update_service_spec.rb b/spec/services/merge_requests/update_service_spec.rb index 0e60baae2c4..b27acb47711 100644 --- a/spec/services/merge_requests/update_service_spec.rb +++ b/spec/services/merge_requests/update_service_spec.rb @@ -5,6 +5,7 @@ describe MergeRequests::UpdateService do let(:user2) { create(:user) } let(:merge_request) { create(:merge_request, :simple) } let(:project) { merge_request.project } + let(:label) { create(:label) } before do project.team << [user, :master] @@ -18,7 +19,8 @@ describe MergeRequests::UpdateService do title: 'New title', description: 'Also please fix', assignee_id: user2.id, - state_event: 'close' + state_event: 'close', + label_ids: [label.id] } end @@ -35,6 +37,8 @@ describe MergeRequests::UpdateService do it { @merge_request.title.should == 'New title' } it { @merge_request.assignee.should == user2 } it { @merge_request.should be_closed } + it { @merge_request.labels.count.should == 1 } + it { @merge_request.labels.first.title.should == 'Bug' } it 'should execute hooks with update action' do expect(service).to have_received(:execute_hooks). @@ -51,6 +55,11 @@ describe MergeRequests::UpdateService do note = @merge_request.notes.last note.note.should include "Reassigned to \@#{user2.username}" end + + it 'should create system note about merge_request label edit' do + note = @merge_request.notes[1] + note.note.should include "Added ~#{label.id} label" + end end end end |