From ea2336b9e2c47a9cc1a73b1350ffc03252e6468e Mon Sep 17 00:00:00 2001 From: Josh Goebel Date: Thu, 21 Mar 2013 14:23:46 -0400 Subject: failure to parse params should trigger a 400 Bad Request --- actionpack/test/dispatch/show_exceptions_test.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'actionpack/test/dispatch/show_exceptions_test.rb') diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 45f8fc11b3..900f45ee5e 100644 --- a/actionpack/test/dispatch/show_exceptions_test.rb +++ b/actionpack/test/dispatch/show_exceptions_test.rb @@ -8,6 +8,8 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest case req.path when "/not_found" raise AbstractController::ActionNotFound + when "/bad_params" + raise ActionDispatch::ParamsParser::ParseError.new("", StandardError.new) when "/method_not_allowed" raise ActionController::MethodNotAllowed when "/not_found_original_exception" @@ -33,6 +35,10 @@ class ShowExceptionsTest < ActionDispatch::IntegrationTest get "/", {}, {'action_dispatch.show_exceptions' => true} assert_response 500 assert_equal "500 error fixture\n", body + + get "/bad_params", {}, {'action_dispatch.show_exceptions' => true} + assert_response 400 + assert_equal "400 error fixture\n", body get "/not_found", {}, {'action_dispatch.show_exceptions' => true} assert_response 404 -- cgit v1.2.3