fix(dossier): can download an expired dossier
This commit is contained in:
parent
bced38eb78
commit
e467be1dbc
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue