Sha256: e63cc0a4f2746fac3a4149fb40ac69f194bfd0fc47b9bf6e051f16feb4fcea0c

Contents?: true

Size: 555 Bytes

Versions: 10

Compression:

Stored size: 555 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
      before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "writer") }
    end

    factory :editor do
      before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "editor") }
    end

    factory :admin do
      before(:create){|user| user.storytime_role = Storytime::Role.find_by(name: "admin") }
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
storytime-1.2.0 spec/factories/user_factories.rb
storytime-1.1.1 spec/factories/user_factories.rb
storytime-1.0.7 spec/factories/user_factories.rb
storytime-1.0.6 spec/factories/user_factories.rb
storytime-1.0.5 spec/factories/user_factories.rb
storytime-1.0.2 spec/factories/user_factories.rb
storytime-1.0.1 spec/factories/user_factories.rb
storytime-1.0.0 spec/factories/user_factories.rb
storytime-0.0.4 spec/factories/user_factories.rb
storytime-0.0.2 spec/factories/user_factories.rb