fix(expert.attestation.url): was pointing to attestation_instructeur_dossier_path, so did not worked when expert was not instructeur. use active_storage_link, secured enough because served to authenticated users as well as expiring link

This commit is contained in:
Martin 2024-03-29 17:22:40 +01:00 committed by Martin
parent 46c5830306
commit 2944a0c2c3
No known key found for this signature in database
GPG key ID: 7CE3E1F5B794A8EC
7 changed files with 6 additions and 20 deletions

View file

@ -35,8 +35,10 @@ describe 'instructeurs/dossiers/show', type: :view do
let(:dossier) { create :dossier, :accepte, :with_attestation }
it 'provides a link to the attestation' do
pdf = dossier.attestation.pdf
expect(dossier).to receive(:attestation).and_return(double(pdf: pdf)).at_least(2)
expect(subject).to have_text('Attestation')
expect(subject).to have_link(href: attestation_instructeur_dossier_path(dossier.procedure, dossier))
expect(subject).to have_text("Télécharger lattestation")
end
end