aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/cookies_test.rb
diff options
context:
space:
mode:
authorGodfrey Chan <godfreykfc@gmail.com>2014-02-04 09:31:48 -0800
committerGodfrey Chan <godfreykfc@gmail.com>2014-02-11 01:54:16 -0800
commitb927d67decb9d4e5103b5991b7e26a4dab4eca92 (patch)
tree352a21a240eac25162de6aacec711805dd693180 /actionpack/test/dispatch/cookies_test.rb
parentf0d8996dcc1feeba83d8b73043a97b6e80ccbe10 (diff)
downloadrails-b927d67decb9d4e5103b5991b7e26a4dab4eca92.tar.gz
rails-b927d67decb9d4e5103b5991b7e26a4dab4eca92.tar.bz2
rails-b927d67decb9d4e5103b5991b7e26a4dab4eca92.zip
Renamed session_serializer option to cookies_serializer
Diffstat (limited to 'actionpack/test/dispatch/cookies_test.rb')
-rw-r--r--actionpack/test/dispatch/cookies_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/actionpack/test/dispatch/cookies_test.rb b/actionpack/test/dispatch/cookies_test.rb
index 6101acdc25..25a2fe199c 100644
--- a/actionpack/test/dispatch/cookies_test.rb
+++ b/actionpack/test/dispatch/cookies_test.rb
@@ -379,28 +379,28 @@ class CookiesTest < ActionController::TestCase
assert_equal 'bar', cookies.encrypted[:foo]
end
- class CustomJsonSerializer
+ class CustomSerializer
def self.load(value)
- JSON.load(value) + " and loaded"
+ value.to_s + " and loaded"
end
def self.dump(value)
- JSON.dump(value + " was dumped")
+ value.to_s + " was dumped"
end
end
def test_encrypted_cookie_using_serializer_object
- @request.env["action_dispatch.session_serializer"] = CustomJsonSerializer
+ @request.env["action_dispatch.cookies_serializer"] = CustomSerializer
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
+ @request.env["action_dispatch.cookies_serializer"] = :json
get :set_encrypted_cookie
cookies = @controller.send :cookies
assert_not_equal 'bar', cookies[:foo]
- assert_raises TypeError do
+ assert_raises ::JSON::ParserError do
cookies.signed[:foo]
end
assert_equal 'bar', cookies.encrypted[:foo]