43569f687e
This is mostly for consistency (both styles were used before). Note: we still have to use `Rack::Test::UploadedFile.new` in factories, because of https://github.com/thoughtbot/factory_bot/issues/385.
15 lines
384 B
Ruby
15 lines
384 B
Ruby
FactoryBot.define do
|
|
factory :commentaire do
|
|
body { 'plop' }
|
|
|
|
before(:create) do |commentaire, _evaluator|
|
|
if !commentaire.dossier
|
|
commentaire.dossier = create :dossier, :en_construction
|
|
end
|
|
end
|
|
|
|
trait :with_file do
|
|
piece_jointe { Rack::Test::UploadedFile.new('spec/fixtures/files/logo_test_procedure.png', 'image/png') }
|
|
end
|
|
end
|
|
end
|