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/alert_management/create_alert_issue_service_spec.rb')
-rw-r--r--spec/services/alert_management/create_alert_issue_service_spec.rb26
1 files changed, 25 insertions, 1 deletions
diff --git a/spec/services/alert_management/create_alert_issue_service_spec.rb b/spec/services/alert_management/create_alert_issue_service_spec.rb
index cf24188a738..f2be317a13d 100644
--- a/spec/services/alert_management/create_alert_issue_service_spec.rb
+++ b/spec/services/alert_management/create_alert_issue_service_spec.rb
@@ -66,7 +66,7 @@ RSpec.describe AlertManagement::CreateAlertIssueService do
end
it 'sets the issue description' do
- expect(created_issue.description).to include(alert_presenter.issue_summary_markdown.strip)
+ expect(created_issue.description).to include(alert_presenter.send(:issue_summary_markdown).strip)
end
end
@@ -82,6 +82,30 @@ RSpec.describe AlertManagement::CreateAlertIssueService do
expect(user).to have_received(:can?).with(:create_issue, project)
end
+ context 'with alert severity' do
+ using RSpec::Parameterized::TableSyntax
+
+ where(:alert_severity, :incident_severity) do
+ 'critical' | 'critical'
+ 'high' | 'high'
+ 'medium' | 'medium'
+ 'low' | 'low'
+ 'info' | 'unknown'
+ 'unknown' | 'unknown'
+ end
+
+ with_them do
+ before do
+ alert.update!(severity: alert_severity)
+ execute
+ end
+
+ it 'sets the correct severity level' do
+ expect(created_issue.severity).to eq(incident_severity)
+ end
+ end
+ end
+
context 'when the alert is prometheus alert' do
let(:alert) { prometheus_alert }
let(:issue) { subject.payload[:issue] }