demarches-normaliennes/spec/factories/attestation_template.rb
Pierre de La Morinerie 43569f687e specs: use fixture_file_upload rather than Rack::Test::UploadedFile
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.
2020-07-01 11:13:45 +02:00

13 lines
394 B
Ruby

FactoryBot.define do
factory :attestation_template do
title { 'title' }
body { 'body' }
footer { 'footer' }
activated { true }
end
trait :with_files do
logo { Rack::Test::UploadedFile.new('spec/fixtures/files/logo_test_procedure.png', 'image/png') }
signature { Rack::Test::UploadedFile.new('spec/fixtures/files/logo_test_procedure.png', 'image/png') }
end
end