Sha256: 29554f6b8d8ca8f2f7541b3d8630ae288646bf88db9baadf1c1a678c7475928a

Contents?: true

Size: 879 Bytes

Versions: 15

Compression:

Stored size: 879 Bytes

Contents

FactoryGirl.define do
  factory :admin, :class => User do |f|
    f.sequence(:username){|n| "admin_#{n}"}
    f.sequence(:email){|n| "admin_#{n}@example.jp"}
    f.role {Role.find_by_name('Administrator')}
    f.password 'adminpassword'
    f.password_confirmation 'adminpassword'
  end

  factory :librarian, :class => User do |f|
    f.sequence(:username){|n| "librarian_#{n}"}
    f.sequence(:email){|n| "librarian_#{n}@example.jp"}
    f.role {Role.find_by_name('Librarian')}
    f.password 'librarianpassword'
    f.password_confirmation 'librarianpassword'
  end

  factory :user, :class => User do |f|
    f.sequence(:username){|n| "user_#{n}"}
    f.sequence(:email){|n| "user_#{n}@example.jp"}
    f.role {Role.find_by_name('User')}
    f.password 'userpassword'
    f.password_confirmation 'userpassword'
  end

  factory :invalid_user, :class => User do |f|
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
enju_circulation-0.2.3 spec/factories/user.rb
enju_circulation-0.2.2 spec/factories/user.rb
enju_circulation-0.2.1 spec/factories/user.rb
enju_circulation-0.2.0 spec/factories/user.rb
enju_circulation-0.2.0.beta.4 spec/factories/user.rb
enju_circulation-0.2.0.beta.3 spec/factories/user.rb
enju_circulation-0.2.0.beta.2 spec/factories/user.rb
enju_circulation-0.2.0.beta.1 spec/factories/user.rb
enju_circulation-0.1.2 spec/factories/user.rb
enju_circulation-0.1.1 spec/factories/user.rb
enju_circulation-0.1.0 spec/factories/user.rb
enju_circulation-0.1.0.pre49 spec/factories/user.rb
enju_circulation-0.1.0.pre48 spec/factories/user.rb
enju_circulation-0.1.0.pre47 spec/factories/user.rb
enju_circulation-0.1.0.pre46 spec/factories/user.rb