summaryrefslogtreecommitdiff
path: root/spec/factories/alert_management/http_integrations.rb
blob: 43cf8b3c6db7b16a9955b86114911aa9f965dbcd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# frozen_string_literal: true

FactoryBot.define do
  factory :alert_management_http_integration, class: 'AlertManagement::HttpIntegration' do
    project
    active { true }
    name { 'DataDog' }
    endpoint_identifier { SecureRandom.hex(4) }

    trait :inactive do
      active { false }
    end

    trait :active do
      active { true }
    end

    trait :legacy do
      endpoint_identifier { 'legacy' }
    end

    trait :prometheus do
      type_identifier { :prometheus }
    end

    initialize_with { new(**attributes) }

    factory :alert_management_prometheus_integration, traits: [:prometheus]
  end
end