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/issues | |
parent | 0a34f2dcb562098c481140246f7ac22683b38d76 (diff) |
Add labels notes
Diffstat (limited to 'spec/services/issues')
-rw-r--r-- | spec/services/issues/update_service_spec.rb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 36030577835..964b3a707e4 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -5,6 +5,7 @@ describe Issues::UpdateService do let(:user) { create(:user) } let(:user2) { create(:user) } let(:issue) { create(:issue) } + let(:label) { create(:label) } before do project.team << [user, :master] @@ -18,7 +19,8 @@ describe Issues::UpdateService do title: 'New title', description: 'Also please fix', assignee_id: user2.id, - state_event: 'close' + state_event: 'close', + label_ids: [label.id] } @issue = Issues::UpdateService.new(project, user, opts).execute(issue) @@ -29,6 +31,8 @@ describe Issues::UpdateService do it { @issue.title.should == 'New title' } it { @issue.assignee.should == user2 } it { @issue.should be_closed } + it { @issue.labels.count.should == 1 } + it { @issue.labels.first.title.should == 'Bug' } it 'should send email to user2 about assign of new issue' do email = ActionMailer::Base.deliveries.last @@ -40,6 +44,11 @@ describe Issues::UpdateService do note = @issue.notes.last note.note.should include "Reassigned to \@#{user2.username}" end + + it 'should create system note about issue label edit' do + note = @issue.notes[1] + note.note.should include "Added ~#{label.id} label" + end end end end |