demarches-normaliennes/spec/factories/commentaire.rb

18 lines
442 B
Ruby
Raw Normal View History

2018-01-23 17:15:42 +01:00
FactoryBot.define do
factory :commentaire do
association :dossier, :en_construction
email { generate(:user_email) }
body { 'plop' }
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
end
end
2015-08-20 17:30:17 +02:00
end