aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/session
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/test/controller/session')
-rw-r--r--actionpack/test/controller/session/cookie_store_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb
index c406188972..48a961ca34 100644
--- a/actionpack/test/controller/session/cookie_store_test.rb
+++ b/actionpack/test/controller/session/cookie_store_test.rb
@@ -209,7 +209,8 @@ class CookieStoreTest < ActionController::IntegrationTest
# expires header should not be changed
get '/no_session_access'
assert_response :success
- assert_equal cookie, headers['Set-Cookie']
+ assert_equal cookie, headers['Set-Cookie'],
+ "#{unmarshal_session(cookie).inspect} expected but was #{unmarshal_session(headers['Set-Cookie']).inspect}"
end
end
@@ -224,4 +225,13 @@ class CookieStoreTest < ActionController::IntegrationTest
yield
end
end
+
+ def unmarshal_session(cookie_string)
+ session = Rack::Utils.parse_query(cookie_string, ';,').inject({}) {|h,(k,v)|
+ h[k] = Array === v ? v.first : v
+ h
+ }[SessionKey]
+ verifier = ActiveSupport::MessageVerifier.new(SessionSecret, 'SHA1')
+ verifier.verify(session)
+ end
end