diff options
author | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-04-25 20:10:20 +0200 |
---|---|---|
committer | Zeger-Jan van de Weg <zegerjan@gitlab.com> | 2016-05-10 12:03:13 +0200 |
commit | dccf8a9fc8d4dde91942944f6b47387bfb13c380 (patch) | |
tree | 7574eea0adcc0cd46bf3d685fccec0d08c37b252 /spec/services/notes | |
parent | 4eb16290e4e95c0a9bcf3d01ecc8060d91eec021 (diff) | |
download | gitlab-ce-dccf8a9fc8d4dde91942944f6b47387bfb13c380.tar.gz |
Add tests on Awardables and Award Emoji
Diffstat (limited to 'spec/services/notes')
-rw-r--r-- | spec/services/notes/create_service_spec.rb | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index ff23f13e1cb..93e8a7094e2 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -14,7 +14,7 @@ describe Notes::CreateService, services: true do noteable_type: 'Issue', noteable_id: issue.id } - + @note = Notes::CreateService.new(project, user, opts).execute end @@ -28,18 +28,16 @@ describe Notes::CreateService, services: true do project.team << [user, :master] end - it "creates emoji note" do + it "creates an award emoji" do opts = { note: ':smile: ', noteable_type: 'Issue', noteable_id: issue.id } + note = Notes::CreateService.new(project, user, opts).execute - @note = Notes::CreateService.new(project, user, opts).execute - - expect(@note).to be_valid - expect(@note.note).to eq('smile') - expect(@note.is_award).to be_truthy + expect(note).to be_valid + expect(note.name).to eq('smile') end it "creates regular note if emoji name is invalid" do @@ -48,12 +46,10 @@ describe Notes::CreateService, services: true do noteable_type: 'Issue', noteable_id: issue.id } + note = Notes::CreateService.new(project, user, opts).execute - @note = Notes::CreateService.new(project, user, opts).execute - - expect(@note).to be_valid - expect(@note.note).to eq(opts[:note]) - expect(@note.is_award).to be_falsy + expect(note).to be_valid + expect(note.note).to eq(opts[:note]) end end end |