demarches-normaliennes/spec/factories/instructeur.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
298 B
Ruby

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