Refactoring: Clean up user_spec.rb

This commit is contained in:
Ryan Lue 2019-01-31 12:41:54 +08:00 committed by Martin Edenhofer
parent 590a8f7614
commit c02d7f2159
2 changed files with 423 additions and 631 deletions

View file

@ -1,21 +1,14 @@
FactoryBot.define do FactoryBot.define do
sequence :email do |n|
"nicole.braun#{n}@zammad.org"
end
end
FactoryBot.define do
factory :user do factory :user do
login 'nicole.braun' login { 'nicole.braun' }
firstname 'Nicole' firstname { 'Nicole' }
lastname 'Braun' lastname { 'Braun' }
email { generate(:email) } sequence(:email) { |n| "nicole.braun#{n}@zammad.org" }
password nil password { nil }
active true active { true }
login_failed 0 login_failed { 0 }
updated_by_id 1 updated_by_id { 1 }
created_by_id 1 created_by_id { 1 }
factory :customer_user, aliases: %i[customer] do factory :customer_user, aliases: %i[customer] do
role_ids { Role.signup_role_ids.sort } role_ids { Role.signup_role_ids.sort }

File diff suppressed because it is too large Load diff