Welcome to mirror list, hosted at ThFree Co, Russian Federation.

prometheus_alert_event.rb « factories « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7771a8d5cb7dbd49e9dfeed4a0ff97fe379c3e25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

FactoryBot.define do
  factory :prometheus_alert_event do
    project { prometheus_alert.project }
    prometheus_alert
    sequence(:payload_key) { |n| "hash payload key #{n}" }
    status { PrometheusAlertEvent.status_value_for(:firing) }
    started_at { Time.now }

    trait :resolved do
      status { PrometheusAlertEvent.status_value_for(:resolved) }
      ended_at { Time.now }
      payload_key { nil }
    end
  end
end