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/services/notes/create_service_spec.rb')
-rw-r--r--spec/services/notes/create_service_spec.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/services/notes/create_service_spec.rb b/spec/services/notes/create_service_spec.rb
index f087f72ca46..7c0d4b756bd 100644
--- a/spec/services/notes/create_service_spec.rb
+++ b/spec/services/notes/create_service_spec.rb
@@ -41,7 +41,7 @@ RSpec.describe Notes::CreateService do
end
it 'TodoService#new_note is called' do
- note = build(:note, project: project)
+ note = build(:note, project: project, noteable: issue)
allow(Note).to receive(:new).with(opts) { note }
expect_any_instance_of(TodoService).to receive(:new_note).with(note, user)
@@ -50,13 +50,23 @@ RSpec.describe Notes::CreateService do
end
it 'enqueues NewNoteWorker' do
- note = build(:note, id: non_existing_record_id, project: project)
+ note = build(:note, id: non_existing_record_id, project: project, noteable: issue)
allow(Note).to receive(:new).with(opts) { note }
expect(NewNoteWorker).to receive(:perform_async).with(note.id)
described_class.new(project, user, opts).execute
end
+
+ context 'issue is an incident' do
+ subject { described_class.new(project, user, opts).execute }
+
+ let(:issue) { create(:incident, project: project) }
+
+ it_behaves_like 'an incident management tracked event', :incident_management_incident_comment do
+ let(:current_user) { user }
+ end
+ end
end
context 'noteable highlight cache clearing' do