aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorDylan Smith <Dylan.Smith@shopify.com>2013-01-09 15:26:12 -0500
committerDylan Smith <Dylan.Smith@shopify.com>2013-01-11 00:28:32 -0500
commitbae92681be97191edda90990e08b5275d187107f (patch)
tree71445260ff346809533fa27a993995f3f2b6ffd1 /actionpack/test
parent8a7fad8970aadea3a79657ef09d3247786e27c2e (diff)
downloadrails-bae92681be97191edda90990e08b5275d187107f.tar.gz
rails-bae92681be97191edda90990e08b5275d187107f.tar.bz2
rails-bae92681be97191edda90990e08b5275d187107f.zip
Fix json params parsing regression for non-object JSON content.
Fixes #8845.
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/dispatch/request/json_params_parsing_test.rb7
1 files changed, 7 insertions, 0 deletions
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