factories: add traits about files

This commit is contained in:
simon lehericey 2023-05-15 12:54:01 +02:00 committed by LeSim
parent e9115b10b5
commit 6f41f0e1c6
2 changed files with 12 additions and 0 deletions

View file

@ -29,5 +29,13 @@ FactoryBot.define do
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
trait :with_introduction do
introduction_file { Rack::Test::UploadedFile.new('spec/fixtures/files/white.png', 'image/png') }
end
trait :with_piece_justificative do
piece_justificative_file { Rack::Test::UploadedFile.new('spec/fixtures/files/white.png', 'image/png') }
end
end
end

View file

@ -1,5 +1,9 @@
FactoryBot.define do
factory :dossier_operation_log do
operation { :passer_en_instruction }
trait :with_serialized do
serialized { Rack::Test::UploadedFile.new('spec/fixtures/files/white.png', 'image/png') }
end
end
end