Sha256: cd86ca02e5f2d369680b57609ba6e7c481c796aa69ad898a380d3cc6832ed2ab

Contents?: true

Size: 1.26 KB

Versions: 27

Compression:

Stored size: 1.26 KB

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'
    f.user_group {UserGroup.first}
    f.required_role {Role.find_by_name('User')}
    f.sequence(:user_number){|n| "user_number_#{n}"}
  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'
    f.user_group {UserGroup.first}
    f.required_role {Role.find_by_name('User')}
    f.sequence(:user_number){|n| "user_number_#{n}"}
  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'
    f.user_group {UserGroup.find(2)}
    f.required_role {Role.find_by_name('User')}
    f.sequence(:user_number){|n| "user_number_#{n}"}
  end

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

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
enju_circulation-0.1.0.pre36 spec/factories/user.rb
enju_circulation-0.1.0.pre35 spec/factories/user.rb
enju_circulation-0.1.0.pre34 spec/factories/user.rb
enju_circulation-0.1.0.pre33 spec/factories/user.rb
enju_circulation-0.1.0.pre32 spec/factories/user.rb
enju_circulation-0.1.0.pre31 spec/factories/user.rb
enju_circulation-0.1.0.pre30 spec/factories/user.rb
enju_circulation-0.1.0.pre29 spec/factories/user.rb
enju_circulation-0.1.0.pre28 spec/factories/user.rb
enju_circulation-0.1.0.pre27 spec/factories/user.rb
enju_circulation-0.1.0.pre26 spec/factories/user.rb
enju_circulation-0.1.0.pre25 spec/factories/user.rb
enju_circulation-0.1.0.pre24 spec/factories/user.rb
enju_circulation-0.1.0.pre23 spec/factories/user.rb
enju_circulation-0.1.0.pre22 spec/factories/user.rb
enju_circulation-0.1.0.pre21 spec/factories/user.rb
enju_circulation-0.1.0.pre20 spec/factories/user.rb
enju_circulation-0.1.0.pre19 spec/factories/user.rb
enju_circulation-0.1.0.pre18 spec/factories/user.rb
enju_circulation-0.1.0.pre17 spec/factories/user.rb