aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorr7kamura <r7kamura@gmail.com>2018-12-18 18:34:14 +0900
committerr7kamura <r7kamura@gmail.com>2018-12-18 21:44:05 +0900
commiteb37fd0aec4fdc5122ceeb8a56b1e9b0cb5e3b76 (patch)
tree513e3ed4140f2f59c398524945fa8ea49a539b1d /actionpack/test
parentd99984d48c6eeb105c5edd1c142834a5c770f499 (diff)
downloadrails-eb37fd0aec4fdc5122ceeb8a56b1e9b0cb5e3b76.tar.gz
rails-eb37fd0aec4fdc5122ceeb8a56b1e9b0cb5e3b76.tar.bz2
rails-eb37fd0aec4fdc5122ceeb8a56b1e9b0cb5e3b76.zip
Allow nil params on controller HTTP test methods
Diffstat (limited to 'actionpack/test')
-rw-r--r--actionpack/test/controller/test_case_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb
index c931e2daac..bc64135589 100644
--- a/actionpack/test/controller/test_case_test.rb
+++ b/actionpack/test/controller/test_case_test.rb
@@ -478,6 +478,18 @@ XML
)
end
+ def test_nil_params
+ get :test_params, params: nil
+ parsed_params = JSON.parse(@response.body)
+ assert_equal(
+ {
+ "action" => "test_params",
+ "controller" => "test_case_test/test"
+ },
+ parsed_params
+ )
+ end
+
def test_query_param_named_action
get :test_query_parameters, params: { action: "foobar" }
parsed_params = JSON.parse(@response.body)