summaryrefslogtreecommitdiff
path: root/spec/factories/alert_management/alerts.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-07-20 12:26:25 +0000
commita09983ae35713f5a2bbb100981116d31ce99826e (patch)
tree2ee2af7bd104d57086db360a7e6d8c9d5d43667a /spec/factories/alert_management/alerts.rb
parent18c5ab32b738c0b6ecb4d0df3994000482f34bd8 (diff)
downloadgitlab-ce-a09983ae35713f5a2bbb100981116d31ce99826e.tar.gz
Add latest changes from gitlab-org/gitlab@13-2-stable-ee
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