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 106
106
# Check development sent emails
107
107
mount LetterOpenerWeb ::Engine , at : "/letter_opener" if Rails . env . development?
108
108
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
+
109
115
end
Original file line number Diff line number Diff line change 4
4
include Rambulance ::TestHelper
5
5
6
6
describe "Error requests" do
7
- it 'should render a corresponding error page' do
7
+ it 'renders the 404 error page' do
8
8
with_exceptions_app do
9
9
get '/does_not_exist'
10
10
end
11
+ expect ( response . status ) . to eq ( 404 )
12
+ end
11
13
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 )
13
26
end
14
27
end
15
28
end
You can’t perform that action at this time.
0 commit comments