user.rb 763 B

1234567891011121314151617181920212223242526272829
  1. FactoryGirl.define do
  2. sequence :email do |n|
  3. "nicole.braun#{n}@zammad.org"
  4. end
  5. end
  6. FactoryGirl.define do
  7. factory :user do
  8. login 'nicole.braun'
  9. firstname 'Nicole'
  10. lastname 'Braun'
  11. email { generate(:email) }
  12. password 'zammad'
  13. active true
  14. login_failed 0
  15. updated_by_id 1
  16. created_by_id 1
  17. end
  18. factory :user_login_failed, parent: :user do
  19. login_failed { (Setting.get('password_max_login_failed').to_i || 10) + 1 }
  20. end
  21. factory :user_legacy_password_sha2, parent: :user do
  22. after(:build) { |user| user.class.skip_callback(:validation, :before, :ensure_password) }
  23. password '{sha2}dd9c764fa7ea18cd992c8600006d3dc3ac983d1ba22e9ba2d71f6207456be0ba' # zammad
  24. end
  25. end