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

This commit is contained in:
Joshua Peek 2009-03-15 23:41:47 -05:00
parent 46c12fdcb6
commit 0706de4301
1 changed files with 11 additions and 1 deletions

View File

@ -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