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-17.0.4 spec/factories/pages.rb
pageflow-17.0.3 spec/factories/pages.rb
pageflow-17.0.2 spec/factories/pages.rb
pageflow-17.0.1 spec/factories/pages.rb
pageflow-17.0.0 spec/factories/pages.rb
pageflow-16.2.0 spec/factories/pages.rb
pageflow-16.1.0 spec/factories/pages.rb
pageflow-16.0.0 spec/factories/pages.rb
pageflow-15.8.0 spec/factories/pages.rb
pageflow-14.5.2 spec/factories/pages.rb
pageflow-15.7.1 spec/factories/pages.rb
pageflow-15.7.0 spec/factories/pages.rb
pageflow-15.6.1 spec/factories/pages.rb
pageflow-15.6.0 spec/factories/pages.rb
pageflow-15.5.0 spec/factories/pages.rb
pageflow-15.4.0 spec/factories/pages.rb
pageflow-15.3.0 spec/factories/pages.rb
pageflow-15.2.2 spec/factories/pages.rb
pageflow-15.2.1 spec/factories/pages.rb
pageflow-15.2.0 spec/factories/pages.rb