This commit is contained in:
Kara Diaby 2024-02-21 02:01:24 +00:00
parent 5488067801
commit 2612b0a2d1
7 changed files with 43 additions and 15 deletions

View file

@ -2,11 +2,16 @@ FactoryBot.define do
factory :commentaire do
association :dossier, :en_construction
email { generate(:user_email) }
body { 'plop' }
trait :with_file do
piece_jointe { Rack::Test::UploadedFile.new('spec/fixtures/files/logo_test_procedure.png', 'image/png') }
after(:build) do |commentaire|
commentaire.piece_jointe.attach(
io: File.open('spec/fixtures/files/logo_test_procedure.png'),
filename: 'logo_test_procedure.png',
content_type: 'image/png'
)
end
end
end
end