Sha256: fc6eab3982e8022fe7b7d541c9efaeee5ea747b8e0119f144170efcea3475220

Contents?: true

Size: 854 Bytes

Versions: 30

Compression:

Stored size: 854 Bytes

Contents

# frozen_string_literal: true

require "factory_bot"
require "alchemy/test_support/factories/page_factory"

FactoryBot.define do
  factory :alchemy_element, class: "Alchemy::Element" do
    name { "article" }
    autogenerate_contents { false }
    association :page, factory: :alchemy_page

    trait :fixed do
      fixed { true }
      name { "right_column" }
    end

    trait :unique do
      unique { true }
      name { "header" }
    end

    trait :trashed do
      after(:create) do |element|
        element.update_column(:position, :null)
      end
    end

    trait :with_nestable_elements do
      name { "slider" }
    end

    trait :nested do
      association :parent_element, factory: :alchemy_element, name: "slider"
      name { "slide" }
    end

    trait :with_contents do
      autogenerate_contents { true }
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
alchemy_cms-5.1.10 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.10 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.9 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.9 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.8 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.8 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.7 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.7 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.6 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.6 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.5 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.5 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.4 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.4 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.3 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.2.0.b1 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.2 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.1 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.0.3 lib/alchemy/test_support/factories/element_factory.rb
alchemy_cms-5.1.0 lib/alchemy/test_support/factories/element_factory.rb