Sha256: fd137c59ae7feac8fe77b8397333363353724cdde044a8257adfe923152da7e6

Contents?: true

Size: 969 Bytes

Versions: 10

Compression:

Stored size: 969 Bytes

Contents

FactoryGirl.define do
  sequence :email do |n|
    "person#{n}@example.com"
  end

  factory :admin_user, class: Brightcontent::AdminUser do
    email
    password "password"
    password_confirmation "password"
  end

  factory :blog do
    name "Blogname"
    body "Inhoud"
    featured false

    factory :featured_blog do
      featured true
    end
  end

  factory :grouped_blog do
    name "Blogname"
    body "Inhoud"
  end

  factory :author do
    factory :author_with_blogs do
      transient do
        blogs_count 5
      end
      after(:create) do |author, evaluator|
        create_list(:blog, evaluator.blogs_count, author: author)
      end

    end
    factory :author_with_grouped_blogs do
      transient do
        blogs_count 5
      end
      after(:create) do |author, evaluator|
        create_list(:grouped_blog, evaluator.blogs_count, author: author)
      end
    end
  end

  factory :comment do
    text "Comment text"
    blog
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
brightcontent-core-2.6.0 spec/factories.rb
brightcontent-core-2.5.1 spec/factories.rb
brightcontent-core-2.5.0 spec/factories.rb
brightcontent-core-2.4.6 spec/factories.rb
brightcontent-core-2.4.5 spec/factories.rb
brightcontent-core-2.4.4 spec/factories.rb
brightcontent-core-2.4.3 spec/factories.rb
brightcontent-core-2.4.2 spec/factories.rb
brightcontent-core-2.4.1 spec/factories.rb
brightcontent-core-2.4.0 spec/factories.rb