2018-01-23 17:15:42 +01:00
|
|
|
FactoryBot.define do
|
2015-08-13 15:55:19 +02:00
|
|
|
factory :commentaire do
|
2020-07-20 16:34:42 +02:00
|
|
|
association :dossier, :en_construction
|
2023-06-28 12:18:26 +02:00
|
|
|
email { generate(:user_email) }
|
2020-07-20 16:34:42 +02:00
|
|
|
body { 'plop' }
|
2019-06-25 17:12:44 +02:00
|
|
|
|
|
|
|
trait :with_file do
|
2024-02-21 03:01:24 +01:00
|
|
|
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
|
2019-06-25 17:12:44 +02:00
|
|
|
end
|
2015-08-13 15:55:19 +02:00
|
|
|
end
|
2015-08-20 17:30:17 +02:00
|
|
|
end
|