Sha256: e14648b79f3ff882222ef246fa810905dae4a65804489c5e15853ed49026c414

Contents?: true

Size: 1.26 KB

Versions: 229

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.first}
    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

229 entries across 229 versions & 7 rubygems

Version Path
enju_oai-0.1.0.pre15 spec/factories/user.rb
enju_inventory-0.1.11.pre10 spec/factories/user.rb
enju_oai-0.1.0.pre14 spec/factories/user.rb
enju_biblio-0.1.0.pre55 spec/factories/user.rb
enju_biblio-0.1.0.pre54 spec/factories/user.rb
enju_library-0.1.0.pre33 spec/factories/user.rb
enju_biblio-0.1.0.pre53 spec/factories/user.rb
enju_oai-0.1.0.pre13 spec/factories/user.rb
enju_library-0.1.0.pre32 spec/factories/user.rb
enju_biblio-0.1.0.pre52 spec/factories/user.rb
enju_library-0.1.0.pre31 spec/factories/user.rb
enju_biblio-0.1.0.pre51 spec/factories/user.rb
enju_oai-0.1.0.pre12 spec/factories/user.rb
enju_library-0.1.0.pre30 spec/factories/user.rb
enju_library-0.1.0.pre29 spec/factories/user.rb
enju_biblio-0.1.0.pre50 spec/factories/user.rb
enju_biblio-0.1.0.pre49 spec/factories/user.rb
enju_library-0.1.0.pre28 spec/factories/user.rb
enju_biblio-0.1.0.pre48 spec/factories/user.rb
enju_oai-0.1.0.pre11 spec/factories/user.rb