Sha256: 406df2a7029b131fae10754df85524c598bd2dc43b1cde259d052c111eeb8740

Contents?: true

Size: 535 Bytes

Versions: 22

Compression:

Stored size: 535 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :webhook do
    sequence(:name) { |n| "Webhook #{n}" }
    target_url { 'https://hook.example.com/api/callback' }
    event { 'subnet_created.event.foreman' }
    enabled { true }
    webhook_template

    trait :with_template do
      transient do
        template { 'template content' }
      end
      after(:build) do |webhook, evaluator|
        webhook.webhook_template = FactoryBot.create(:webhook_template, template: evaluator.template)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
foreman_webhooks-4.0.0 test/factories/webhook.rb
foreman_webhooks-3.2.3 test/factories/webhook.rb
foreman_webhooks-3.2.2 test/factories/webhook.rb
foreman_webhooks-3.1.1 test/factories/webhook.rb
foreman_webhooks-3.2.1 test/factories/webhook.rb
foreman_webhooks-3.2.0 test/factories/webhook.rb
foreman_webhooks-3.1.0 test/factories/webhook.rb
foreman_webhooks-3.0.5 test/factories/webhook.rb
foreman_webhooks-2.0.3 test/factories/webhook.rb
foreman_webhooks-3.0.4 test/factories/webhook.rb
foreman_webhooks-2.0.2 test/factories/webhook.rb
foreman_webhooks-3.0.3 test/factories/webhook.rb
foreman_webhooks-3.0.2 test/factories/webhook.rb
foreman_webhooks-3.0.1 test/factories/webhook.rb
foreman_webhooks-2.0.1 test/factories/webhook.rb
foreman_webhooks-3.0.0 test/factories/webhook.rb
foreman_webhooks-2.0.0 test/factories/webhook.rb
foreman_webhooks-1.1.0 test/factories/webhook.rb
foreman_webhooks-1.0.0 test/factories/webhook.rb
foreman_webhooks-0.0.3 test/factories/webhook.rb