diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-04-25 21:10:20 +0300 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-05-10 13:03:13 +0300 |
commit | dccf8a9fc8d4dde91942944f6b47387bfb13c380 (patch) | |
tree | 7574eea0adcc0cd46bf3d685fccec0d08c37b252 /spec/services/todo_service_spec.rb | |
parent | 4eb16290e4e95c0a9bcf3d01ecc8060d91eec021 (diff) |
Add tests on Awardables and Award Emoji
Diffstat (limited to 'spec/services/todo_service_spec.rb')
-rw-r--r-- | spec/services/todo_service_spec.rb | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/spec/services/todo_service_spec.rb b/spec/services/todo_service_spec.rb index 82b7fbfa816..455b19c89cc 100644 --- a/spec/services/todo_service_spec.rb +++ b/spec/services/todo_service_spec.rb @@ -137,7 +137,6 @@ describe TodoService, services: true do let(:note_on_commit) { create(:note_on_commit, project: project, author: john_doe, note: mentions) } let(:note_on_confidential_issue) { create(:note_on_issue, noteable: confidential_issue, project: project, note: mentions) } let(:note_on_project_snippet) { create(:note_on_project_snippet, project: project, author: john_doe, note: mentions) } - let(:award_note) { create(:note, :award, project: project, noteable: issue, author: john_doe, note: 'thumbsup') } let(:system_note) { create(:system_note, project: project, noteable: issue) } it 'mark related pending todos to the noteable for the note author as done' do @@ -150,13 +149,6 @@ describe TodoService, services: true do expect(second_todo.reload).to be_done end - it 'mark related pending todos to the noteable for the award note author as done' do - service.new_note(award_note, john_doe) - - expect(first_todo.reload).to be_done - expect(second_todo.reload).to be_done - end - it 'does not mark related pending todos it is a system note' do service.new_note(system_note, john_doe) @@ -286,6 +278,15 @@ describe TodoService, services: true do expect(second_todo.reload).to be_done end end + + describe '#new_award_emoji' do + it 'marks related pending todos to the target for the user as done' do + todo = create(:todo, user: john_doe, project: project, target: mr_assigned, author: author) + service.new_award_emoji(mr_assigned, john_doe) + + expect(todo.reload).to be_done + end + end end def should_create_todo(attributes = {}) |