Sha256: 1b815cfed9aaed72ed65815ad972a7fa0f97124219868bb3319804da4b9bafaa

Contents?: true

Size: 890 Bytes

Versions: 3

Compression:

Stored size: 890 Bytes

Contents

FactoryBot.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

3 entries across 3 versions & 2 rubygems

Version Path
enju_oai-0.3.1 spec/factories/user.rb
enju_question-0.3.2 spec/factories/user.rb
enju_question-0.3.1 spec/factories/user.rb