demarches-normaliennes/spec/factories/commentaire.rb

12 lines
239 B
Ruby
Raw Normal View History

2018-01-23 17:15:42 +01:00
FactoryBot.define do
factory :commentaire do
2018-09-04 16:46:48 +02:00
body { 'plop' }
2016-12-26 18:37:27 +01:00
before(:create) do |commentaire, _evaluator|
2018-01-11 19:04:39 +01:00
if !commentaire.dossier
commentaire.dossier = create :dossier, :en_construction
2016-12-26 18:37:27 +01:00
end
end
end
2015-08-20 17:30:17 +02:00
end