models: require belong_to associations on commentaire

This commit is contained in:
Pierre de La Morinerie 2020-07-20 16:34:42 +02:00
parent 32e55a6d37
commit dd1bed9340
3 changed files with 9 additions and 11 deletions

View file

@ -1,12 +1,8 @@
FactoryBot.define do
factory :commentaire do
body { 'plop' }
association :dossier, :en_construction
before(:create) do |commentaire, _evaluator|
if !commentaire.dossier
commentaire.dossier = create :dossier, :en_construction
end
end
body { 'plop' }
trait :with_file do
piece_jointe { Rack::Test::UploadedFile.new('spec/fixtures/files/logo_test_procedure.png', 'image/png') }