Sha256: bf43fe73f15eb963fb10c76157819a5dd972f5bd5317aa629b196ee8b989e47d

Contents?: true

Size: 429 Bytes

Versions: 7

Compression:

Stored size: 429 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :widget, class: "Archangel::Widget" do
    site
    template nil
    sequence(:name) { |n| "Widget #{n}" }
    sequence(:slug) { |n| "widget-#{n}" }
    content "<p>Content of the widget</p>"

    trait :with_template do
      association :template, factory: :template, partial: true
    end

    trait :deleted do
      deleted_at { Time.current }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
archangel-0.0.8 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.7 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.6 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.5 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.4 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.3 lib/archangel/testing_support/factories/archangel_widgets.rb
archangel-0.0.2 lib/archangel/testing_support/factories/archangel_widgets.rb