diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-11 21:43:28 +0100 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2016-02-11 22:47:17 +0100 |
commit | 77bbf1e905f2ff82d715bac3f0b255cf3ade1d97 (patch) | |
tree | 92d656470f586125b41293f2d268d4d96855df29 /actionpack/test | |
parent | f9f98b75b57f7ab264e6af0abcda898fe166b828 (diff) | |
download | rails-77bbf1e905f2ff82d715bac3f0b255cf3ade1d97.tar.gz rails-77bbf1e905f2ff82d715bac3f0b255cf3ade1d97.tar.bz2 rails-77bbf1e905f2ff82d715bac3f0b255cf3ade1d97.zip |
Make `parsed_body` extract parser from the content type.
We're not guaranteed to have a `RequestEncoder` to assign on `get` requests
because we aren't extracting the parser from the response content type.
Until now.
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/integration_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb index cb524bacb2..ea50f05f4d 100644 --- a/actionpack/test/controller/integration_test.rb +++ b/actionpack/test/controller/integration_test.rb @@ -1171,6 +1171,16 @@ class IntegrationRequestEncodersTest < ActionDispatch::IntegrationTest Mime::Type.unregister :wibble end + def test_parsed_body_without_as_option + with_routing do |routes| + routes.draw { get ':action' => FooController } + + get '/foos_json.json', params: { foo: 'heyo' } + + assert_equal({ 'foo' => 'heyo' }, response.parsed_body) + end + end + private def post_to_foos(as:) with_routing do |routes| |