Merge pull request #11038 from demarches-simplifiees/fix_404_as_500_in_production

Corrige les 404 qui finissaient en erreur 500 en production
This commit is contained in:
Mathieu Magnin 2024-11-14 10:19:15 +00:00 committed by GitHub
commit 19e46ac619
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 10 deletions

View file

@ -3,6 +3,15 @@
describe 'Errors handling', js: false do
let(:procedure) { create(:procedure) }
scenario 'not found returns 404' do
without_detailed_exceptions do
visit '/nonexistent-path'
end
expect(page).to have_http_status(:not_found)
expect(page).to have_content('Page non trouvée')
end
scenario 'bug renders dynamic 500 page' do
procedure.revisions.destroy_all # break procedure