aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorTom Prats <tprats108@gmail.com>2015-07-12 02:01:30 -0400
committerTom Prats <tprats108@gmail.com>2016-01-29 17:22:05 -0500
commit82dc8266dddc199789f3f1e9a9f21975e1c8ee87 (patch)
treec7b1747445c3bd5d76933eaf49e6022a8128ceeb /actionpack/test
parent513f72804d800bb9a028f6ffc66ab1a0b45df26f (diff)
downloadrails-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.rb10
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 {