diff options
author | Jean Boussier <jean.boussier@gmail.com> | 2015-04-18 10:31:29 -0400 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2015-04-18 16:08:33 -0400 |
commit | fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe (patch) | |
tree | c2574f2a244d6e719823b5720693d00940ddbdd6 /actionpack/test | |
parent | 228559eab8e50dd52e1f07841a288ed39c84ff4e (diff) | |
download | rails-fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe.tar.gz rails-fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe.tar.bz2 rails-fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe.zip |
Allow to parameters named `action` or `controller` from AC::TestCase helpers
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 e348749f78..4bda440331 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: { |