Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 09:06:26 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2019-11-14 09:06:26 +0300
commitd9251dac4c8f9e27f1e2db4b537d47d7d5a9e5be (patch)
treea57ef4e98f815acc864bfd523e1436d3774fa05a /spec/workers/new_note_worker_spec.rb
parent29c01c6c91558358c37ba45b03f240632bfb918d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers/new_note_worker_spec.rb')
-rw-r--r--spec/workers/new_note_worker_spec.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/spec/workers/new_note_worker_spec.rb b/spec/workers/new_note_worker_spec.rb
index 2966a201a62..ae62237960a 100644
--- a/spec/workers/new_note_worker_spec.rb
+++ b/spec/workers/new_note_worker_spec.rb
@@ -7,16 +7,17 @@ describe NewNoteWorker do
let(:note) { create(:note) }
it "calls NotificationService#new_note" do
- expect_any_instance_of(NotificationService).to receive(:new_note).with(note)
+ expect_next_instance_of(NotificationService) do |service|
+ expect(service).to receive(:new_note).with(note)
+ end
described_class.new.perform(note.id)
end
it "calls Notes::PostProcessService#execute" do
- notes_post_process_service = double(Notes::PostProcessService)
- allow(Notes::PostProcessService).to receive(:new).with(note) { notes_post_process_service }
-
- expect(notes_post_process_service).to receive(:execute)
+ expect_next_instance_of(Notes::PostProcessService) do |service|
+ expect(service).to receive(:execute)
+ end
described_class.new.perform(note.id)
end
@@ -36,14 +37,14 @@ describe NewNoteWorker do
expect { described_class.new.perform(unexistent_note_id) }.not_to raise_error
end
- it "does not call NotificationService#new_note" do
- expect_any_instance_of(NotificationService).not_to receive(:new_note)
+ it "does not call NotificationService" do
+ expect(NotificationService).not_to receive(:new)
described_class.new.perform(unexistent_note_id)
end
- it "does not call Notes::PostProcessService#execute" do
- expect_any_instance_of(Notes::PostProcessService).not_to receive(:execute)
+ it "does not call Notes::PostProcessService" do
+ expect(Notes::PostProcessService).not_to receive(:new)
described_class.new.perform(unexistent_note_id)
end