1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Assert that DebugExceptions renders HTML by default

This would have made the correct implementation for
894ed87a7e more obvious.
This commit is contained in:
Eugene Kenny 2020-07-20 22:37:35 +01:00
parent fba67f1da1
commit 57daae230b

View file

@ -192,30 +192,37 @@ class DebugExceptionsTest < ActionDispatch::IntegrationTest
get "/", headers: { "action_dispatch.show_exceptions" => true }
assert_response 500
assert_match(/<body>/, body)
assert_match(/puke/, body)
get "/not_found", headers: { "action_dispatch.show_exceptions" => true }
assert_response 404
assert_match(/<body>/, body)
assert_match(/#{AbstractController::ActionNotFound.name}/, body)
get "/method_not_allowed", headers: { "action_dispatch.show_exceptions" => true }
assert_response 405
assert_match(/<body>/, body)
assert_match(/ActionController::MethodNotAllowed/, body)
get "/unknown_http_method", headers: { "action_dispatch.show_exceptions" => true }
assert_response 405
assert_match(/<body>/, body)
assert_match(/ActionController::UnknownHttpMethod/, body)
get "/bad_request", headers: { "action_dispatch.show_exceptions" => true }
assert_response 400
assert_match(/<body>/, body)
assert_match(/ActionController::BadRequest/, body)
get "/parameter_missing", headers: { "action_dispatch.show_exceptions" => true }
assert_response 400
assert_match(/<body>/, body)
assert_match(/ActionController::ParameterMissing/, body)
get "/invalid_mimetype", headers: { "Accept" => "text/html,*", "action_dispatch.show_exceptions" => true }
assert_response 406
assert_match(/<body>/, body)
assert_match(/Mime::Type::InvalidMimeType/, body)
end