summaryrefslogtreecommitdiff
path: root/spec/workers/incident_management/process_alert_worker_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/incident_management/process_alert_worker_spec.rb')
-rw-r--r--spec/workers/incident_management/process_alert_worker_spec.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/workers/incident_management/process_alert_worker_spec.rb b/spec/workers/incident_management/process_alert_worker_spec.rb
index bed6dc59ac7..20ab283b49b 100644
--- a/spec/workers/incident_management/process_alert_worker_spec.rb
+++ b/spec/workers/incident_management/process_alert_worker_spec.rb
@@ -18,15 +18,15 @@ RSpec.describe IncidentManagement::ProcessAlertWorker do
before do
allow(Gitlab::AppLogger).to receive(:warn).and_call_original
- allow(IncidentManagement::CreateIssueService)
- .to receive(:new).with(alert.project, parsed_payload)
+ allow(AlertManagement::CreateAlertIssueService)
+ .to receive(:new).with(alert, User.alert_bot)
.and_call_original
end
shared_examples 'creates issue successfully' do
it 'creates an issue' do
- expect(IncidentManagement::CreateIssueService)
- .to receive(:new).with(alert.project, parsed_payload)
+ expect(AlertManagement::CreateAlertIssueService)
+ .to receive(:new).with(alert, User.alert_bot)
expect { subject }.to change { Issue.count }.by(1)
end
@@ -58,10 +58,10 @@ RSpec.describe IncidentManagement::ProcessAlertWorker do
subject
expect(Gitlab::AppLogger).to have_received(:warn).with(
- message: 'Cannot link an Issue with Alert',
+ message: 'Cannot process an Incident',
issue_id: created_issue.id,
alert_id: alert.id,
- alert_errors: { hosts: ['hosts array is over 255 chars'] }
+ errors: 'Hosts hosts array is over 255 chars'
)
end
end
@@ -80,7 +80,7 @@ RSpec.describe IncidentManagement::ProcessAlertWorker do
subject { described_class.new.perform(nil, nil, invalid_alert_id) }
it 'does not create issues' do
- expect(IncidentManagement::CreateIssueService).not_to receive(:new)
+ expect(AlertManagement::CreateAlertIssueService).not_to receive(:new)
expect { subject }.not_to change { Issue.count }
end