diff options
author | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-30 00:24:28 -0800 |
---|---|---|
committer | Godfrey Chan <godfreykfc@gmail.com> | 2014-01-30 00:24:28 -0800 |
commit | 1917293dae366d5d6028da351460c8bccf22d21f (patch) | |
tree | 4430a718660e01bd50556e93a270da8f82c28a2c /actionpack/test | |
parent | db5d6bf74f3f6423e56120198685b8665e59616e (diff) | |
parent | fd487860db3097104cdb8d589f3931d75b767721 (diff) | |
download | rails-1917293dae366d5d6028da351460c8bccf22d21f.tar.gz rails-1917293dae366d5d6028da351460c8bccf22d21f.tar.bz2 rails-1917293dae366d5d6028da351460c8bccf22d21f.zip |
Merge pull request #13888 from rails/session-serializer
Modify the session serializer implementation
Diffstat (limited to 'actionpack/test')
-rw-r--r-- | actionpack/test/dispatch/cookies_test.rb | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb index b19ce905f5..6101acdc25 100644 --- a/actionpack/test/dispatch/cookies_test.rb +++ b/actionpack/test/dispatch/cookies_test.rb @@ -379,7 +379,7 @@ class CookiesTest < ActionController::TestCase assert_equal 'bar', cookies.encrypted[:foo] end - class ActionDispatch::Session::CustomJsonSerializer + class CustomJsonSerializer def self.load(value) JSON.load(value) + " and loaded" end @@ -389,20 +389,14 @@ class CookiesTest < ActionController::TestCase end end - def test_encrypted_cookie_using_custom_json_serializer - @request.env["action_dispatch.session_serializer"] = :custom_json_serializer - get :set_encrypted_cookie - assert_equal 'bar was dumped and loaded', cookies.encrypted[:foo] - end - def test_encrypted_cookie_using_serializer_object - @request.env["action_dispatch.session_serializer"] = ActionDispatch::Session::CustomJsonSerializer + @request.env["action_dispatch.session_serializer"] = CustomJsonSerializer get :set_encrypted_cookie assert_equal 'bar was dumped and loaded', cookies.encrypted[:foo] end def test_encrypted_cookie_using_json_serializer - @request.env["action_dispatch.session_serializer"] = :json_serializer + @request.env["action_dispatch.session_serializer"] = :json get :set_encrypted_cookie cookies = @controller.send :cookies assert_not_equal 'bar', cookies[:foo] |