From fc9cd89de91f0808e6d6b7ba05b3800b95b1b6fe Mon Sep 17 00:00:00 2001 From: Jean Boussier Date: Sat, 18 Apr 2015 10:31:29 -0400 Subject: Allow to parameters named `action` or `controller` from AC::TestCase helpers --- actionpack/test/controller/test_case_test.rb | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'actionpack/test/controller') 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: { -- cgit v1.2.3