Sha256: 318629cf710958735a8fec086036c26403583242877587ac3d4f22070a7372f6

Contents?: true

Size: 558 Bytes

Versions: 5

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :webhook_template do
    sequence(:name) { |n| "webhook_template#{n}" }
    sequence(:template) { |n| "template content #{n}" }

    trait :snippet do
      snippet { true }
    end

    trait :locked do
      locked { true }
    end

    trait :with_webhooks do
      transient do
        webhooks_count { 2 }
      end

      after(:create) do |webhook_template, evaluator|
        create_list(:webhook, evaluator.webhooks_count, webhook_template: webhook_template)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
foreman_webhooks-4.0.0 test/factories/webhook_template.rb
foreman_webhooks-3.2.3 test/factories/webhook_template.rb
foreman_webhooks-3.2.2 test/factories/webhook_template.rb
foreman_webhooks-3.2.1 test/factories/webhook_template.rb
foreman_webhooks-3.2.0 test/factories/webhook_template.rb