Skip to content

Commit

Permalink
Assert that DebugExceptions renders HTML by default
Browse files Browse the repository at this point in the history
This would have made the correct implementation for
894ed87 more obvious.
  • Loading branch information
eugeneius committed Jul 20, 2020
1 parent fba67f1 commit 57daae2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions actionpack/test/dispatch/debug_exceptions_test.rb
Expand Up @@ -192,30 +192,37 @@ def call(env)

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

Expand Down

0 comments on commit 57daae2

Please sign in to comment.