Permalink
Browse files

Better error message to try to figure out why the CI build is failing

  • Loading branch information...
1 parent 46c12fd commit 0706de4301bbf12a4c369bd4776ad58affee9ad4 @josh josh committed Mar 16, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 actionpack/test/controller/session/cookie_store_test.rb
@@ -209,7 +209,8 @@ def test_session_store_with_expire_after
# 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 @@ def with_test_route_set
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

0 comments on commit 0706de4

Please sign in to comment.