user.rb 647 B

1234567891011121314151617181920212223242526272829303132
  1. FactoryBot.define do
  2. sequence :email do |n|
  3. "nicole.braun#{n}@zammad.org"
  4. end
  5. end
  6. FactoryBot.define do
  7. factory :user do
  8. login 'nicole.braun'
  9. firstname 'Nicole'
  10. lastname 'Braun'
  11. email { generate(:email) }
  12. password nil
  13. active true
  14. login_failed 0
  15. updated_by_id 1
  16. created_by_id 1
  17. end
  18. factory :customer_user, parent: :user do
  19. role_ids { Role.signup_role_ids.sort }
  20. end
  21. factory :agent_user, parent: :user do
  22. roles { Role.where(name: 'Agent') }
  23. end
  24. factory :admin_user, parent: :user do
  25. roles { Role.where(name: %w[Admin Agent]) }
  26. end
  27. end