summaryrefslogtreecommitdiff
path: root/spec/factories/prometheus_alert.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/factories/prometheus_alert.rb')
-rw-r--r--spec/factories/prometheus_alert.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/factories/prometheus_alert.rb b/spec/factories/prometheus_alert.rb
new file mode 100644
index 00000000000..a9fede9efca
--- /dev/null
+++ b/spec/factories/prometheus_alert.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+FactoryBot.define do
+ factory :prometheus_alert do
+ project
+ operator { :gt }
+ threshold { 1 }
+
+ environment do |alert|
+ build(:environment, project: alert.project)
+ end
+
+ prometheus_metric do |alert|
+ build(:prometheus_metric, project: alert.project)
+ end
+ end
+end