diff options
author | Tom Prats <tprats108@gmail.com> | 2015-07-12 02:01:30 -0400 |
---|---|---|
committer | Tom Prats <tprats108@gmail.com> | 2016-01-29 17:22:05 -0500 |
commit | 82dc8266dddc199789f3f1e9a9f21975e1c8ee87 (patch) | |
tree | c7b1747445c3bd5d76933eaf49e6022a8128ceeb /actionpack/test | |
parent | 513f72804d800bb9a028f6ffc66ab1a0b45df26f (diff) | |
download | rails-82dc8266dddc199789f3f1e9a9f21975e1c8ee87.tar.gz rails-82dc8266dddc199789f3f1e9a9f21975e1c8ee87.tar.bz2 rails-82dc8266dddc199789f3f1e9a9f21975e1c8ee87.zip |
Update session to have indifferent access
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/request/session_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/request/session_test.rb b/actionpack/test/dispatch/request/session_test.rb index 7dcbcc5c21..3fc4ffd71c 100644 --- a/actionpack/test/dispatch/request/session_test.rb +++ b/actionpack/test/dispatch/request/session_test.rb @@ -105,6 +105,16 @@ module ActionDispatch end end + def test_with_indifferent_access + s = Session.create(store, req, {}) + + s[:one] = { test: "deep" } + s[:two] = { "test" => "deep" } + + assert_equal 'deep', s[:one]["test"] + assert_equal 'deep', s[:two][:test] + end + private def store Class.new { |