aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller
diff options
context:
space:
mode:
authorYuki Nishijima <mail@yukinishijima.net>2014-11-23 13:04:31 -0800
committerYuki Nishijima <mail@yukinishijima.net>2014-11-23 13:47:09 -0800
commit1d85c707b633b6ed1623290fa9aff5d7fd74d05e (patch)
tree0ed2c35481faa20f7ac08767ed5289db99c8b55a /actionpack/test/controller
parentc837259ae422a659b2a71e6f29e3a4f3ea049f05 (diff)
downloadrails-1d85c707b633b6ed1623290fa9aff5d7fd74d05e.tar.gz
rails-1d85c707b633b6ed1623290fa9aff5d7fd74d05e.tar.bz2
rails-1d85c707b633b6ed1623290fa9aff5d7fd74d05e.zip
Do not rescue Exception in ParamsParser
Unlike ShowExceptions or PublicExceptions, ParamsParser shouldn't transform exceptions like Interrupt and NoMemoryError into ParserError.
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r--actionpack/test/controller/webservice_test.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/webservice_test.rb b/actionpack/test/controller/webservice_test.rb
index d80b0e2da0..2b109ff19e 100644
--- a/actionpack/test/controller/webservice_test.rb
+++ b/actionpack/test/controller/webservice_test.rb
@@ -83,6 +83,16 @@ class WebServiceTest < ActionDispatch::IntegrationTest
end
end
+ def test_parsing_json_doesnot_rescue_exception
+ with_test_route_set do
+ with_params_parsers Mime::JSON => Proc.new { |data| raise Interrupt } do
+ assert_raises(Interrupt) do
+ post "/", '{"title":"JSON"}}', 'CONTENT_TYPE' => 'application/json'
+ end
+ end
+ end
+ end
+
private
def with_params_parsers(parsers = {})
old_session = @integration_session