demarches-normaliennes/spec/factories/expert.rb
Pierre de La Morinerie a2b91c8ec6 factories: cleanup Administrateur, Instructeur and Expert factories
This changes:

- avoids relying on application code to create mock objects,
- allows to build Administrateur or Instructeurs without saving them.
2021-10-26 12:03:30 +02:00

12 lines
294 B
Ruby

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