fix(dossier): can download an expired dossier

This commit is contained in:
Colin Darie 2024-07-30 14:06:30 +02:00
parent bced38eb78
commit e467be1dbc
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
2 changed files with 9 additions and 1 deletions

View file

@ -536,7 +536,7 @@ module Users
Dossier.visible_by_user.or(Dossier.for_procedure_preview).or(Dossier.for_editing_fork)
elsif action_name == 'restore'
Dossier.hidden_by_user
elsif action_name == 'extend_conservation_and_restore'
elsif action_name == 'extend_conservation_and_restore' || (action_name == 'show' && request.format.pdf?)
Dossier.visible_by_user.or(Dossier.hidden_by_expired)
else
Dossier.visible_by_user

View file

@ -246,6 +246,14 @@ describe 'user access to the list of their dossiers', js: true do
expect(page).to have_content('2 supprimés récemment')
end
end
context 'when user download PDF of expired' do
scenario "generate PDF" do
click_on "3 supprimés récemment"
click_on 'Télécharger mon dossier', match: :first
# Test fails when an error happens during PDF generation
end
end
end
describe "user search bar" do