Skip to content

Commit

Permalink
Better error message to try to figure out why the CI build is failing
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Mar 16, 2009
1 parent 46c12fd commit 0706de4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion actionpack/test/controller/session/cookie_store_test.rb
Expand Up @@ -209,7 +209,8 @@ def test_session_store_with_expire_after
# expires header should not be changed # expires header should not be changed
get '/no_session_access' get '/no_session_access'
assert_response :success 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
end end


Expand All @@ -224,4 +225,13 @@ def with_test_route_set
yield yield
end end
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 end

0 comments on commit 0706de4

Please sign in to comment.