Fix tests involving attachment urls
This commit is contained in:
parent
785a09b326
commit
c6326bfa77
10 changed files with 14 additions and 13 deletions
|
@ -209,7 +209,6 @@ describe API::V2::GraphqlController do
|
|||
checksum
|
||||
byteSize
|
||||
contentType
|
||||
url
|
||||
}
|
||||
}
|
||||
avis {
|
||||
|
@ -270,8 +269,7 @@ describe API::V2::GraphqlController do
|
|||
filename: commentaire.piece_jointe.filename.to_s,
|
||||
contentType: commentaire.piece_jointe.content_type,
|
||||
checksum: commentaire.piece_jointe.checksum,
|
||||
byteSize: commentaire.piece_jointe.byte_size,
|
||||
url: Rails.application.routes.url_helpers.url_for(commentaire.piece_jointe)
|
||||
byteSize: commentaire.piece_jointe.byte_size
|
||||
},
|
||||
email: commentaire.email
|
||||
}
|
||||
|
|
|
@ -17,9 +17,9 @@ describe Instructeurs::DossiersController, type: :controller do
|
|||
context 'when a dossier has an attestation' do
|
||||
let(:dossier) { create(:dossier, :accepte, attestation: create(:attestation, :with_pdf), procedure: procedure) }
|
||||
|
||||
it 'redirects to attestation pdf' do
|
||||
it 'redirects to a service tmp_url' do
|
||||
get :attestation, params: { procedure_id: procedure.id, dossier_id: dossier.id }
|
||||
expect(response).to redirect_to(dossier.attestation.pdf_url.gsub('http://localhost:3000', ''))
|
||||
expect(response.location).to match '/rails/active_storage/disk/'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -14,7 +14,7 @@ describe NewAdministrateur::MailTemplatesController, type: :controller do
|
|||
it { expect(response).to have_http_status(:ok) }
|
||||
|
||||
it 'displays the procedure logo' do
|
||||
expect(response.body).to have_css("img[src*='#{procedure.logo_url}']")
|
||||
expect(response.body).to have_css("img[src*='/rails/active_storage/blobs/']")
|
||||
end
|
||||
|
||||
it 'displays the action buttons' do
|
||||
|
|
|
@ -145,7 +145,7 @@ describe Users::DossiersController, type: :controller do
|
|||
|
||||
it 'redirects to attestation pdf' do
|
||||
get :attestation, params: { id: dossier.id }
|
||||
expect(response).to redirect_to(dossier.attestation.pdf_url.gsub('http://localhost:3000', ''))
|
||||
expect(response.location).to match '/rails/active_storage/disk/'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue