aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request_test.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/test/dispatch/request_test.rb b/actionpack/test/dispatch/request_test.rb
index a2b9571660..26db91c741 100644
--- a/actionpack/test/dispatch/request_test.rb
+++ b/actionpack/test/dispatch/request_test.rb
@@ -550,12 +550,13 @@ class RequestTest < ActiveSupport::TestCase
test "parameters still accessible after rack parse error" do
mock_rack_env = { "QUERY_STRING" => "x[y]=1&x[y][][w]=2", "rack.input" => "foo" }
request = nil
- begin
- request = stub_request(mock_rack_env)
- request.parameters
- rescue ActionController::BadRequest
+ request = stub_request(mock_rack_env)
+
+ assert_raises(ActionController::BadRequest) do
# rack will raise a TypeError when parsing this query string
+ request.parameters
end
+
assert_equal({}, request.parameters)
end