aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorbogdanvlviv <bogdanvlviv@gmail.com>2018-04-10 05:11:54 +0300
committerbogdanvlviv <bogdanvlviv@gmail.com>2018-04-10 05:17:47 +0300
commit125b71db2204190cec0c183286479ef05e35c459 (patch)
treebd817a1ef7873aabe377583703867d8c6f650f2d /actionpack
parent601e31b362b2f59bed988de716f4b931b2aa0950 (diff)
downloadrails-125b71db2204190cec0c183286479ef05e35c459.tar.gz
rails-125b71db2204190cec0c183286479ef05e35c459.tar.bz2
rails-125b71db2204190cec0c183286479ef05e35c459.zip
Add `TestCaseTest#test_request_format_kwarg_doesnt_mutate_params` to master
Initially, the test was added to 5-0-stable in #32492 and a bit modified in #32506. This test ensures that request(in tests) doesn't mutate params. It was fixed since v5.1.0.beta1 by 98b8309569a326910a723f521911e54994b112fb and then on 5-0-stable by #32492. This commit adds this test to master branch in order to prevent any regressions.
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/test/controller/test_case_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/actionpack/test/controller/test_case_test.rb b/actionpack/test/controller/test_case_test.rb
index 7d4850294d..d1122abba6 100644
--- a/actionpack/test/controller/test_case_test.rb
+++ b/actionpack/test/controller/test_case_test.rb
@@ -740,6 +740,14 @@ XML
assert_equal "application/json", @response.body
end
+ def test_request_format_kwarg_doesnt_mutate_params
+ params = { foo: "bar" }.freeze
+
+ assert_nothing_raised do
+ get :test_format, format: "json", params: params
+ end
+ end
+
def test_should_have_knowledge_of_client_side_cookie_state_even_if_they_are_not_set
cookies["foo"] = "bar"
get :no_op