demarches-normaliennes/spec/factories/avis.rb

24 lines
515 B
Ruby
Raw Normal View History

FactoryGirl.define do
factory :avis do
introduction 'Bonjour, merci de me donner votre avis sur ce dossier'
before(:create) do |avis, _evaluator|
2018-01-11 19:04:39 +01:00
if !avis.gestionnaire
avis.gestionnaire = create :gestionnaire
end
end
before(:create) do |avis, _evaluator|
2018-01-11 19:04:39 +01:00
if !avis.dossier
avis.dossier = create :dossier
end
end
before(:create) do |avis, _evaluator|
2018-01-11 19:04:39 +01:00
if !avis.claimant
avis.claimant = create :gestionnaire
end
end
end
end