diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 13:44:04 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-10-30 13:44:04 -0600 |
commit | eb6cdcab394245bbb08747103dd7b76027933ef1 (patch) | |
tree | 6c66a4f10c57623e39061b37f80d73ae1921d98a | |
parent | 35caf46e86cdbe64a08e282ab60c2ab0160651e3 (diff) | |
parent | 36e53fca785afcc83a9879fe5a3997281d567f8a (diff) | |
download | rails-eb6cdcab394245bbb08747103dd7b76027933ef1.tar.gz rails-eb6cdcab394245bbb08747103dd7b76027933ef1.tar.bz2 rails-eb6cdcab394245bbb08747103dd7b76027933ef1.zip |
Merge pull request #21251 from rodzyn/more_param_parser_tests
Add test for parsing application/vnd.api+json
-rw-r--r-- | actionpack/test/dispatch/request/json_params_parsing_test.rb | 14 |
1 files changed, 14 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 c2300a0142..28ebaed663 100644 --- a/actionpack/test/dispatch/request/json_params_parsing_test.rb +++ b/actionpack/test/dispatch/request/json_params_parsing_test.rb @@ -37,6 +37,13 @@ class JsonParamsParsingTest < ActionDispatch::IntegrationTest ) end + test "parses json params for application/vnd.api+json" do + assert_parses( + {"person" => {"name" => "David"}}, + "{\"person\": {\"name\": \"David\"}}", { 'CONTENT_TYPE' => 'application/vnd.api+json' } + ) + end + test "nils are stripped from collections" do assert_parses( {"person" => []}, @@ -136,6 +143,13 @@ class RootLessJSONParamsParsingTest < ActionDispatch::IntegrationTest ) end + test "parses json params for application/vnd.api+json" do + assert_parses( + {"user" => {"username" => "sikachu"}, "username" => "sikachu"}, + "{\"username\": \"sikachu\"}", { 'CONTENT_TYPE' => 'application/vnd.api+json' } + ) + end + test "parses json with non-object JSON content" do assert_parses( {"user" => {"_json" => "string content" }, "_json" => "string content" }, |