diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /spec/workers/incident_management/process_alert_worker_spec.rb | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'spec/workers/incident_management/process_alert_worker_spec.rb')
-rw-r--r-- | spec/workers/incident_management/process_alert_worker_spec.rb | 14 |
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 |