]> git.openstreetmap.org Git - rails.git/blob - test/controllers/errors_controller_test.rb
Add frozen_string_literal comments to ruby files
[rails.git] / test / controllers / errors_controller_test.rb
1 # frozen_string_literal: true
2
3 require "test_helper"
4
5 class ErrorsControllerTest < ActionDispatch::IntegrationTest
6   def test_routes
7     assert_routing(
8       { :path => "/400", :method => :get },
9       { :controller => "errors", :action => "bad_request" }
10     )
11     assert_routing(
12       { :path => "/403", :method => :get },
13       { :controller => "errors", :action => "forbidden" }
14     )
15     assert_routing(
16       { :path => "/404", :method => :get },
17       { :controller => "errors", :action => "not_found" }
18     )
19     assert_routing(
20       { :path => "/500", :method => :get },
21       { :controller => "errors", :action => "internal_server_error" }
22     )
23   end
24
25   def test_bad_request
26     get "/400"
27     assert_response :bad_request
28   end
29
30   def test_forbidden
31     get "/403"
32     assert_response :forbidden
33   end
34
35   def test_not_found
36     get "/404"
37     assert_response :not_found
38   end
39
40   def test_internal_server_error
41     get "/500"
42     assert_response :internal_server_error
43   end
44 end