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:
Diffstat (limited to 'spec/workers/new_note_worker_spec.rb')
-rw-r--r--spec/workers/new_note_worker_spec.rb12
1 files changed, 9 insertions, 3 deletions
diff --git a/spec/workers/new_note_worker_spec.rb b/spec/workers/new_note_worker_spec.rb
index 21f10fa5bfb..86b6d041e5c 100644
--- a/spec/workers/new_note_worker_spec.rb
+++ b/spec/workers/new_note_worker_spec.rb
@@ -50,10 +50,16 @@ RSpec.describe NewNoteWorker do
end
end
- context 'when note is with review' do
- it 'does not create a new note notification' do
- note = create(:note, :with_review)
+ context 'when note does not require notification' do
+ let(:note) { create(:note) }
+
+ before do
+ allow_next_found_instance_of(Note) do |note|
+ allow(note).to receive(:skip_notification?).and_return(true)
+ end
+ end
+ it 'does not create a new note notification' do
expect_any_instance_of(NotificationService).not_to receive(:new_note)
subject.perform(note.id)