diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-30 17:38:56 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-04-30 17:38:56 -0700 |
commit | fd890f6aea4a0699aab33f70892c33e5212ab728 (patch) | |
tree | 0ac65759cb191b0d6dcb5bd25f7505780efab5ed /actionpack/test/dispatch | |
parent | c68b6f0638fc1b5f8b6b1b5202de476a0ac431ea (diff) | |
parent | ea2336b9e2c47a9cc1a73b1350ffc03252e6468e (diff) | |
download | rails-fd890f6aea4a0699aab33f70892c33e5212ab728.tar.gz rails-fd890f6aea4a0699aab33f70892c33e5212ab728.tar.bz2 rails-fd890f6aea4a0699aab33f70892c33e5212ab728.zip |
Merge pull request #9857 from yyyc514/bad_params_should_400
failure to parse params should trigger a 400 Bad Request
Diffstat (limited to 'actionpack/test/dispatch')
-rw-r--r-- | actionpack/test/dispatch/show_exceptions_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/show_exceptions_test.rb b/actionpack/test/dispatch/show_exceptions_test.rb index 98bbcd954b..38bd234f37 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 "/unknown_http_method" @@ -35,6 +37,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 |