diff options
author | Josh Jordan <josh.jordan@gmail.com> | 2014-01-28 16:51:01 -0500 |
---|---|---|
committer | Josh Jordan <josh.jordan@gmail.com> | 2014-01-30 18:20:55 -0500 |
commit | 1f9586fd4725f5e81177cc6adba879b4869f71af (patch) | |
tree | 7b6e08de731b6b6e9da09d973cc0e365e8561a5c /actionpack/test/controller | |
parent | b9cd5a29dd4c6142b19c861fbf1a67452320b3dd (diff) | |
download | rails-1f9586fd4725f5e81177cc6adba879b4869f71af.tar.gz rails-1f9586fd4725f5e81177cc6adba879b4869f71af.tar.bz2 rails-1f9586fd4725f5e81177cc6adba879b4869f71af.zip |
Do not discard query parameters on requests that use wrap_parameters
Diffstat (limited to 'actionpack/test/controller')
-rw-r--r-- | actionpack/test/controller/params_wrapper_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/params_wrapper_test.rb b/actionpack/test/controller/params_wrapper_test.rb index d87e2b85b0..11ccb6cf3b 100644 --- a/actionpack/test/controller/params_wrapper_test.rb +++ b/actionpack/test/controller/params_wrapper_test.rb @@ -188,6 +188,26 @@ class ParamsWrapperTest < ActionController::TestCase assert_parameters({ 'username' => 'sikachu', 'title' => 'Developer', 'user' => { 'username' => 'sikachu', 'title' => 'Developer' }}) end end + + def test_preserves_query_string_params + with_default_wrapper_options do + @request.env['CONTENT_TYPE'] = 'application/json' + get :parse, { 'user' => { 'username' => 'nixon' } } + assert_parameters( + {'user' => { 'username' => 'nixon' } } + ) + end + end + + def test_empty_parameter_set + with_default_wrapper_options do + @request.env['CONTENT_TYPE'] = 'application/json' + post :parse, {} + assert_parameters( + {'user' => { } } + ) + end + end end class NamespacedParamsWrapperTest < ActionController::TestCase |