diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-08 16:41:46 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-07-08 16:43:58 -0700 |
commit | 5ea8efecd08a71ca78688105a39b8a94236443ed (patch) | |
tree | fde8263f337075520bad0f9fe8017dddd0b4c4b3 /actionpack/test | |
parent | 2838a1f4acccd2849e7b84cbdb140c13b649e211 (diff) | |
download | rails-5ea8efecd08a71ca78688105a39b8a94236443ed.tar.gz rails-5ea8efecd08a71ca78688105a39b8a94236443ed.tar.bz2 rails-5ea8efecd08a71ca78688105a39b8a94236443ed.zip |
build and assign parameters rather than rely on mutations
We should assign parameters to the request object rather than mutate the
hash that is returned by `query_parameters` or `request_parameters`
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/test_case_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index 270052ae9f..531b9b0a81 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -49,7 +49,7 @@ class TestCaseTest < ActionController::TestCase end def test_query_parameters - render text: request.query_parameters.inspect + render text: ::JSON.dump(request.query_parameters) end def test_request_parameters @@ -514,8 +514,8 @@ XML def test_query_param_named_action get :test_query_parameters, params: {action: 'foobar'} - parsed_params = eval(@response.body) - assert_equal({action: 'foobar'}, parsed_params) + parsed_params = JSON.parse(@response.body) + assert_equal({'action' => 'foobar'}, parsed_params) end def test_request_param_named_action |