Sha256: cd37938cff15bccb30bb1e383a3ff3c38dcf5b0f31087fadec5ba269f8ab4702

Contents?: true

Size: 702 Bytes

Versions: 8

Compression:

Stored size: 702 Bytes

Contents

FactoryGirl.define do
  factory :user do
    sequence(:email) { |i| "user#{i}@example.com" }
    password "password"
    sequence(:storytime_name) { |i| "user name #{i}" }

    factory :writer do
      after(:create){|user| user.storytime_memberships.create(site: @current_site, storytime_role: Storytime::Role.find_by(name: "writer")) }
    end

    factory :editor do
      after(:create){|user| user.storytime_memberships.create(site: @current_site, storytime_role: Storytime::Role.find_by(name: "editor")) }
    end

    factory :admin do
      after(:create){|user| user.storytime_memberships.create(site: @current_site, storytime_role: Storytime::Role.find_by(name: "admin")) }
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
storytime-2.1.6 spec/factories/user_factories.rb
storytime-2.1.5 spec/factories/user_factories.rb
storytime-2.1.4 spec/factories/user_factories.rb
storytime-2.1.3 spec/factories/user_factories.rb
storytime-2.1.2 spec/factories/user_factories.rb
storytime-2.1.1 spec/factories/user_factories.rb
storytime-2.1.0 spec/factories/user_factories.rb
storytime-2.0.0 spec/factories/user_factories.rb