From 040ca9cf5b7e193f0fb15166135643daa60f9237 Mon Sep 17 00:00:00 2001 From: Kir Shatrov <shatrov@me.com> Date: Fri, 9 Sep 2016 22:17:10 -0400 Subject: Do not mutate AC::TestRequest::DEFAULT_OPTIONS --- actionpack/test/controller/request/test_request_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/controller/request/test_request_test.rb b/actionpack/test/controller/request/test_request_test.rb index 6e0ca957c3..fa049fbc9f 100644 --- a/actionpack/test/controller/request/test_request_test.rb +++ b/actionpack/test/controller/request/test_request_test.rb @@ -6,6 +6,11 @@ class ActionController::TestRequestTest < ActionController::TestCase assert @request.session_options end + def test_mutating_session_options_does_not_affect_default_options + @request.session_options[:myparam] = 123 + assert_equal nil, ActionController::TestSession::DEFAULT_OPTIONS[:myparam] + end + ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS.each_key do |option| test "rack default session options #{option} exists in session options and is default" do assert_equal(ActionDispatch::Session::AbstractStore::DEFAULT_OPTIONS[option], -- cgit v1.2.3