debian-mirror-gitlab/spec/factories/self_managed_prometheus_alert_event.rb

24 lines
580 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
FactoryBot.define do
factory :self_managed_prometheus_alert_event do
project
sequence(:payload_key) { |n| "hash payload key #{n}" }
status { SelfManagedPrometheusAlertEvent.status_value_for(:firing) }
title { 'alert' }
query_expression { 'vector(2)' }
started_at { Time.now }
trait :resolved do
status { SelfManagedPrometheusAlertEvent.status_value_for(:resolved) }
ended_at { Time.now }
payload_key { nil }
end
trait :none do
status { nil }
started_at { nil }
end
end
end