demarches-normaliennes/spec/factories/invite.rb

18 lines
313 B
Ruby
Raw Normal View History

2018-01-23 17:15:42 +01:00
FactoryBot.define do
factory :invite do
2018-09-04 16:46:48 +02:00
email { 'plop@octo.com' }
user { nil }
association :dossier
after(:build) do |invite, _evaluator|
2018-01-11 19:04:39 +01:00
if invite.user.present?
2017-01-04 18:03:03 +01:00
invite.email = invite.user.email
end
end
trait :with_user do
association :user
end
end
end