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.
This commit is contained in:
Pierre de La Morinerie 2020-06-30 15:53:54 +00:00
parent dbba5644e3
commit 43569f687e
16 changed files with 28 additions and 28 deletions

View file

@ -57,8 +57,8 @@ describe AttestationTemplate, type: :model do
describe 'dup' do
before do
@logo = Rack::Test::UploadedFile.new('spec/fixtures/files/white.png', 'image/png')
@signature = Rack::Test::UploadedFile.new('spec/fixtures/files/black.png', 'image/png')
@logo = fixture_file_upload('spec/fixtures/files/white.png', 'image/png')
@signature = fixture_file_upload('spec/fixtures/files/black.png', 'image/png')
end
after do
@ -89,8 +89,8 @@ describe AttestationTemplate, type: :model do
describe 'invalidate attestation if images attachments are not valid' do
before do
@logo = Rack::Test::UploadedFile.new('spec/fixtures/files/french-flag.gif', 'image/gif')
@signature = Rack::Test::UploadedFile.new('spec/fixtures/files/beta-gouv.gif', 'image/gif')
@logo = fixture_file_upload('spec/fixtures/files/french-flag.gif', 'image/gif')
@signature = fixture_file_upload('spec/fixtures/files/beta-gouv.gif', 'image/gif')
end
after do