Sha256: aaf416b4c9ec078faf052d34d9c9673801362716657b6043baf87e71b2a21db3

Contents?: true

Size: 444 Bytes

Versions: 10

Compression:

Stored size: 444 Bytes

Contents

# Read about factories at https://github.com/thoughtbot/factory_girl

module Pageflow
  FactoryGirl.define do
    factory :chapter, :class => Chapter do
      revision

      transient do
        entry nil
      end

      before(:create) do |chapter, evaluator|
        chapter.revision = evaluator.entry.draft if evaluator.entry
      end
    end

    factory :valid_chapter, :class => Chapter do
      title "Introduction"
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pageflow-0.9.2 spec/factories/chapters.rb
pageflow-0.9.1 spec/factories/chapters.rb
pageflow-0.9.0 spec/factories/chapters.rb
pageflow-0.8.2 spec/factories/chapters.rb
pageflow-0.8.1 spec/factories/chapters.rb
pageflow-0.8.0 spec/factories/chapters.rb
pageflow-0.7.2 spec/factories/chapters.rb
pageflow-0.7.1 spec/factories/chapters.rb
pageflow-0.7.0 spec/factories/chapters.rb
pageflow-0.6.0 spec/factories/chapters.rb