File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 106106 # Check development sent emails
107107 mount LetterOpenerWeb ::Engine , at : "/letter_opener" if Rails . env . development?
108108 mount Rambulance ::Engine => "/"
109+
110+ if Rails . env . development? || Rails . env . test?
111+ get "/trigger_500" , to : -> ( env ) { raise "Triggering 500 error" }
112+ get "/trigger_422" , to : "errors#unprocessable_entity"
113+ end
114+
109115end
Original file line number Diff line number Diff line change 44 include Rambulance ::TestHelper
55
66 describe "Error requests" do
7- it 'should render a corresponding error page' do
7+ it 'renders the 404 error page' do
88 with_exceptions_app do
99 get '/does_not_exist'
1010 end
11+ expect ( response . status ) . to eq ( 404 )
12+ end
1113
12- assert_equal 404 , response . status
14+ it 'renders the 422 error page' do
15+ with_exceptions_app do
16+ get '/trigger_422'
17+ end
18+ expect ( response . status ) . to eq ( 422 )
19+ end
20+
21+ it 'renders the 500 error page' do
22+ with_exceptions_app do
23+ get '/trigger_500'
24+ end
25+ expect ( response . status ) . to eq ( 500 )
1326 end
1427 end
1528end
You can’t perform that action at this time.
0 commit comments