Attestation: uninterlaced png file to be compatible with Prawn

This commit is contained in:
Simon Lehericey 2017-07-05 16:05:37 +02:00
parent 1645ea4a9d
commit 9d48249660
6 changed files with 31 additions and 3 deletions

View file

@ -4,6 +4,8 @@ describe Admin::AttestationTemplatesController, type: :controller do
let!(:procedure) { create :procedure, administrateur: admin, attestation_template: attestation_template }
let(:logo) { fixture_file_upload('spec/fixtures/white.png', 'image/png') }
let(:signature) { fixture_file_upload('spec/fixtures/black.png', 'image/png') }
let(:interlaced_logo) { fixture_file_upload('spec/fixtures/interlaced-black.png', 'image/png') }
let(:uninterlaced_logo) { fixture_file_upload('spec/fixtures/uninterlaced-black.png', 'image/png') }
before do
sign_in admin
@ -19,6 +21,11 @@ describe Admin::AttestationTemplatesController, type: :controller do
attestation_template: upload_params }
end
context 'with an interlaced png' do
let(:upload_params) { { logo: interlaced_logo } }
it { expect(assigns(:logo).read).to eq(uninterlaced_logo.read) }
end
context 'if an attestation template does not exist on the procedure' do
let(:attestation_template) { nil }
it { expect(subject.status).to eq(200) }