Sha256: 0ce90b218cb27bb555b2dc1f8313d093ebe867f3cc803be026d5b8adf6abfd33

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

FactoryBot.define do
  sequence(:email) {|n| "john#{n}@doe.com" }

  factory :user do
    name { "John Doe" }
    email { generate(:email) }
  end

  factory :skill do
    user { users(:john) }
  end

  factory :preload do
    name { "My Preload" }
  end

  preload do
    factory(:john) { create(:user) }
    factory(:ruby) { create(:skill, user: users(:john)) }
    factory(:my)   { create(:preload) }
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
factory_bot-preload-0.1.1 spec/support/factories.rb
factory_bot-preload-0.1.0 spec/support/factories.rb