Sha256: 1c7fc26425c20517eb5d9c9ad08990491f7468519f58c8857423405882fb13c5

Contents?: true

Size: 615 Bytes

Versions: 16

Compression:

Stored size: 615 Bytes

Contents

require 'faker'

FactoryGirl.define do

  factory :post, class: Fuel::Post do
    published false

    factory :published_post do
      author
      title Faker::Lorem.sentence
      content "<p>Some content for a blog post</p>"
      published true
      published_at { DateTime.now - rand(1..100).days }
    end

    factory :invalid_post do
      published true
      title nil
    end

    factory :unpublished_post do
      published false
    end
  end

  factory :author, class: Fuel::Author do
    first_name Faker::Name.first_name
    last_name Faker::Name.last_name
    title Faker::Name.title
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
fuel-0.4.10 spec/factories.rb
fuel-0.4.9 spec/factories.rb
fuel-0.4.8 spec/factories.rb
fuel-0.4.7 spec/factories.rb
fuel-0.4.6 spec/factories.rb
fuel-0.4.5 spec/factories.rb
fuel-0.4.4 spec/factories.rb
fuel-0.4.3 spec/factories.rb
fuel-0.4.2 spec/factories.rb
fuel-0.4.1 spec/factories.rb
fuel-0.3.34 spec/factories.rb
fuel-0.3.33 spec/factories.rb
fuel-0.3.32 spec/factories.rb
fuel-0.3.31 spec/factories.rb
fuel-0.3.30 spec/factories.rb
fuel-0.3.29 spec/factories.rb