Sha256: cd5e9559eda8328392912c1485063e80e7bc366f7ce090256eb339833d934a05

Contents?: true

Size: 576 Bytes

Versions: 52

Compression:

Stored size: 576 Bytes

Contents

module Pageflow
  FactoryBot.define do
    factory :page, :class => Page do
      chapter
      template { 'background_image' }
      configuration { {} }

      transient do
        revision { nil }
      end

      before(:create) do |page, evaluator|
        if evaluator.revision
          storyline = create(:storyline, revision: evaluator.revision)
          page.chapter = create(:chapter, storyline: storyline)
        end
      end
    end

    factory :valid_page, :class => Page do
      template { 'background_image' }
      configuration { {} }
    end
  end
end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
pageflow-15.0.0.beta2 spec/factories/pages.rb
pageflow-15.0.0.beta1 spec/factories/pages.rb
pageflow-14.3.0 spec/factories/pages.rb
pageflow-14.2.1 spec/factories/pages.rb
pageflow-14.2.0 spec/factories/pages.rb
pageflow-14.1.1 spec/factories/pages.rb
pageflow-14.1.0 spec/factories/pages.rb
pageflow-14.0.0 spec/factories/pages.rb
pageflow-14.0.0.rc2 spec/factories/pages.rb
pageflow-14.0.0.rc1 spec/factories/pages.rb
pageflow-14.0.0.beta3 spec/factories/pages.rb
pageflow-14.0.0.beta2 spec/factories/pages.rb