aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
diff options
context:
space:
mode:
authorIgor Kasyanchuk <igorkasyanchuk@gmail.com>2018-01-31 13:36:01 -0800
committerIgor Kasyanchuk <igorkasyanchuk@gmail.com>2018-01-31 13:36:01 -0800
commit2587cadd4223f4abc1a94fdfb14cfd8c8d60e28b (patch)
tree34ca3563a8466f21a819b6675c74b366325e4f7b /actionpack/test/dispatch/cookies_test.rb
parent148d0077c539ebca99a8cf776902805da3431f95 (diff)
downloadrails-2587cadd4223f4abc1a94fdfb14cfd8c8d60e28b.tar.gz
rails-2587cadd4223f4abc1a94fdfb14cfd8c8d60e28b.tar.bz2
rails-2587cadd4223f4abc1a94fdfb14cfd8c8d60e28b.zip
Consistent behavior for session and cookies with to_h and to_hash method
Diffstat (limited to 'actionpack/test/dispatch/cookies_test.rb')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index f01c9eed77..94cff10fe4 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -36,6 +36,12 @@ class CookieJarTest < ActiveSupport::TestCase
assert_equal "bar", request.cookie_jar.fetch(:foo)
end
+ def test_to_hash
+ request.cookie_jar["foo"] = "bar"
+ assert_equal({ "foo" => "bar" }, request.cookie_jar.to_hash)
+ assert_equal({ "foo" => "bar" }, request.cookie_jar.to_h)
+ end
+
def test_fetch_type_error
assert_raises(KeyError) do
request.cookie_jar.fetch(:omglolwut)