2018-01-23 17:15:42 +01:00
|
|
|
|
FactoryBot.define do
|
2017-04-27 12:17:50 +02:00
|
|
|
|
factory :avis do
|
2018-09-04 16:46:48 +02:00
|
|
|
|
introduction { 'Bonjour, merci de me donner votre avis sur ce dossier' }
|
2017-04-27 12:17:50 +02:00
|
|
|
|
|
|
|
|
|
before(:create) do |avis, _evaluator|
|
2019-08-06 11:02:54 +02:00
|
|
|
|
if !avis.instructeur
|
|
|
|
|
avis.instructeur = create :instructeur
|
2017-04-27 12:17:50 +02:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
before(:create) do |avis, _evaluator|
|
2018-01-11 19:04:39 +01:00
|
|
|
|
if !avis.dossier
|
2017-04-27 12:17:50 +02:00
|
|
|
|
avis.dossier = create :dossier
|
|
|
|
|
end
|
|
|
|
|
end
|
2017-05-23 13:28:17 +02:00
|
|
|
|
|
|
|
|
|
before(:create) do |avis, _evaluator|
|
2018-01-11 19:04:39 +01:00
|
|
|
|
if !avis.claimant
|
2019-08-06 11:02:54 +02:00
|
|
|
|
avis.claimant = create :instructeur
|
2017-05-23 13:28:17 +02:00
|
|
|
|
end
|
|
|
|
|
end
|
2019-04-04 10:13:24 +02:00
|
|
|
|
|
|
|
|
|
trait :with_answer do
|
|
|
|
|
answer { "Mon avis se décompose en deux points :\n- La demande semble pertinente\n- Le demandeur remplit les conditions." }
|
|
|
|
|
end
|
2017-04-27 12:17:50 +02:00
|
|
|
|
end
|
|
|
|
|
end
|