Merge pull request #10667 from colinux/fix-dossier-expire-download

ETQ usager : correctif pour télécharger un dossier expiré
This commit is contained in:
Colin Darie 2024-07-30 12:13:39 +00:00 committed by GitHub
commit a41f03ef92
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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