summaryrefslogtreecommitdiff
path: root/spec/factories/alert_management/alerts.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/alert_management/alerts.rb')
-rw-r--r--spec/factories/alert_management/alerts.rb28
1 files changed, 25 insertions, 3 deletions
diff --git a/spec/factories/alert_management/alerts.rb b/spec/factories/alert_management/alerts.rb
index 8724a626d77..ef511aa54b8 100644
--- a/spec/factories/alert_management/alerts.rb
+++ b/spec/factories/alert_management/alerts.rb
@@ -16,7 +16,9 @@ FactoryBot.define do
end
trait :with_issue do
- issue
+ after(:create) do |alert|
+ create(:issue, alert_management_alert: alert, project: alert.project)
+ end
end
trait :with_assignee do |alert|
@@ -73,10 +75,30 @@ FactoryBot.define do
without_ended_at
end
- trait :low_severity do
+ trait :critical do
+ severity { 'critical' }
+ end
+
+ trait :high do
+ severity { 'high' }
+ end
+
+ trait :medium do
+ severity { 'medium' }
+ end
+
+ trait :low do
severity { 'low' }
end
+ trait :info do
+ severity { 'info' }
+ end
+
+ trait :unknown do
+ severity { 'unknown' }
+ end
+
trait :prometheus do
monitoring_tool { Gitlab::AlertManagement::AlertParams::MONITORING_TOOLS[:prometheus] }
end
@@ -89,7 +111,7 @@ FactoryBot.define do
with_monitoring_tool
with_host
with_description
- low_severity
+ low
end
end
end