Sha256: 6358d747bdaedef85e7988af4b579d54ccd4382dc0a50ecbf776184688dab118

Contents?: true

Size: 496 Bytes

Versions: 87

Compression:

Stored size: 496 Bytes

Contents

# frozen_string_literal: true

FactoryBot.define do
  factory :alchemy_page_version, class: "Alchemy::PageVersion" do
    association :page, factory: :alchemy_page

    trait :published do
      public_on { Time.current }
    end

    transient do
      element_count { 1 }
    end

    trait :with_elements do
      after(:build) do |page_version, evaluator|
        evaluator.element_count.times do
          page_version.elements.build(name: "article")
        end
      end
    end
  end
end

Version data entries

87 entries across 87 versions & 1 rubygems

Version Path
alchemy_cms-7.3.4 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.3.3 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.3.2 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.7 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.3.1 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.3.0 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.6 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.5 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.1.12 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.0.15 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-6.1.10 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.4 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.1.11 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.3 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.1.10 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.2 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.1.9 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.0.14 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.2.1 lib/alchemy/test_support/factories/page_version_factory.rb
alchemy_cms-7.0.13 lib/alchemy/test_support/factories/page_version_factory.rb