From bae92681be97191edda90990e08b5275d187107f Mon Sep 17 00:00:00 2001 From: Dylan Smith Date: Wed, 9 Jan 2013 15:26:12 -0500 Subject: Fix json params parsing regression for non-object JSON content. Fixes #8845. --- actionpack/test/dispatch/request/json_params_parsing_test.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'actionpack/test/dispatch') diff --git a/actionpack/test/dispatch/request/json_params_parsing_test.rb b/actionpack/test/dispatch/request/json_params_parsing_test.rb index 2c4a6c2147..7d3fc84089 100644 --- a/actionpack/test/dispatch/request/json_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/json_params_parsing_test.rb @@ -122,6 +122,13 @@ class RootLessJSONParamsParsingTest < ActionDispatch::IntegrationTest ) end + test "parses json with non-object JSON content" do + assert_parses( + {"user" => {"_json" => "string content" }, "_json" => "string content" }, + "\"string content\"", { 'CONTENT_TYPE' => 'application/json' } + ) + end + private def assert_parses(expected, actual, headers = {}) with_test_routing(UsersController) do -- cgit v1.2.3