diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-27 21:43:45 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-05-27 21:43:45 -0300 |
commit | f02f2872426a5973bd2da720f843748d12c11513 (patch) | |
tree | 2785538d22cc4c6d3ded1d7bf15d31b8fb0c1c5a /actionpack/test | |
parent | 99c042b3ccaca51bbe249fd2f2bfedf544629ef8 (diff) | |
parent | fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe (diff) | |
download | rails-f02f2872426a5973bd2da720f843748d12c11513.tar.gz rails-f02f2872426a5973bd2da720f843748d12c11513.tar.bz2 rails-f02f2872426a5973bd2da720f843748d12c11513.zip |
Merge pull request #19808 from byroot/action-parameter
[PoC] Stop shadowing parameters named `action`
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/controller/test_case_test.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb index a1afdc32c7..37f27c5d36 100644 --- a/actionpack/test/controller/test_case_test.rb +++ b/actionpack/test/controller/test_case_test.rb @@ -48,6 +48,14 @@ class TestCaseTest < ActionController::TestCase render text: params.inspect end + def test_query_parameters + render text: request.query_parameters.inspect + end + + def test_request_parameters + render text: request.request_parameters.inspect + end + def test_uri render text: request.fullpath end @@ -547,6 +555,18 @@ XML ) end + def test_query_param_named_action + get :test_query_parameters, params: {action: 'foobar'} + parsed_params = eval(@response.body) + assert_equal({action: 'foobar'}, parsed_params) + end + + def test_request_param_named_action + post :test_request_parameters, params: {action: 'foobar'} + parsed_params = eval(@response.body) + assert_equal({'action' => 'foobar'}, parsed_params) + end + def test_kwarg_params_passing_with_session_and_flash get :test_params, params: { page: { |