demarches-normaliennes/spec/factories/expert.rb
2021-01-20 18:03:06 +01:00

14 lines
323 B
Ruby

FactoryBot.define do
sequence(:create_expert_email) { |n| "expert#{n}@expert.com" }
factory :expert do
transient do
email { generate(:expert_email) }
password { 'somethingverycomplated!' }
end
initialize_with do
User.create_or_promote_to_expert(email, password).expert
end
end
end