diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-05-18 13:23:40 -0500 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2016-05-18 13:23:40 -0500 |
commit | 6c89e2fd41a39e2cfde623405d01aa63469370d1 (patch) | |
tree | ef65d5edc9eaed5aa93814c0fe2706b8ba7c9728 /spec/services | |
parent | a410c7afbfe78ca5253e4b2e2dfcffb20e8159da (diff) | |
parent | e0cabb67d0492907e6cef21bb0ef21a6e953b70b (diff) | |
download | gitlab-ce-6c89e2fd41a39e2cfde623405d01aa63469370d1.tar.gz |
Merge branch 'awardables' of gitlab.com:gitlab-org/gitlab-ce into awardables
Diffstat (limited to 'spec/services')
-rw-r--r-- | spec/services/notes/create_service_spec.rb | 2 | ||||
-rw-r--r-- | spec/services/toggle_award_emoji_service_spec.rb | 33 |
2 files changed, 1 insertions, 34 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb index 4e62e3975ea..35f576874b8 100644 --- a/spec/services/notes/create_service_spec.rb +++ b/spec/services/notes/create_service_spec.rb @@ -59,7 +59,7 @@ describe Notes::CreateService, services: true do noteable_id: issue.id } - expect_any_instance_of(ToggleAwardEmojiService).to receive(:execute).with(issue, "thumbsup") + expect_any_instance_of(TodoService).to receive(:new_award_emoji).with(issue, user) Notes::CreateService.new(project, user, opts).execute end diff --git a/spec/services/toggle_award_emoji_service_spec.rb b/spec/services/toggle_award_emoji_service_spec.rb deleted file mode 100644 index b9d63bd70a7..00000000000 --- a/spec/services/toggle_award_emoji_service_spec.rb +++ /dev/null @@ -1,33 +0,0 @@ -require 'spec_helper' - -describe ToggleAwardEmoji, services: true do - let(:project) { create(:project) } - let(:user) { create(:user) } - let(:issue) { create(:issue, project: project) } - - before do - project.team << [user, :master] - end - - describe '#execute' do - it 'removes related todos' do - expect_any_instance_of(TodoService).to receive(:new_award_emoji).with(issue, user) - - ToggleAwardEmojiService.new(project, user).execute(issue, "thumbsdown") - end - - context 'when the emoji is set' do - it 'removes the emoji' do - create(:award_emoji, awardable: issue, user: user) - - expect { ToggleAwardEmojiService.new(project, user).execute(issue, "thumbsup") }.to change { AwardEmoji.count }.by(-1) - end - end - - context 'when the award is not set yet' do - it 'awards the emoji' do - expect { ToggleAwardEmojiService.new(project, user).execute(issue, "thumbsup") }.to change { AwardEmoji.count }.by(1) - end - end - end -end |