Skip to content

Commit 0706de4

Browse files
committed
Better error message to try to figure out why the CI build is failing
1 parent 46c12fd commit 0706de4

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

actionpack/test/controller/session/cookie_store_test.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ def test_session_store_with_expire_after
209209
# expires header should not be changed
210210
get '/no_session_access'
211211
assert_response :success
212-
assert_equal cookie, headers['Set-Cookie']
212+
assert_equal cookie, headers['Set-Cookie'],
213+
"#{unmarshal_session(cookie).inspect} expected but was #{unmarshal_session(headers['Set-Cookie']).inspect}"
213214
end
214215
end
215216

@@ -224,4 +225,13 @@ def with_test_route_set
224225
yield
225226
end
226227
end
228+
229+
def unmarshal_session(cookie_string)
230+
session = Rack::Utils.parse_query(cookie_string, ';,').inject({}) {|h,(k,v)|
231+
h[k] = Array === v ? v.first : v
232+
h
233+
}[SessionKey]
234+
verifier = ActiveSupport::MessageVerifier.new(SessionSecret, 'SHA1')
235+
verifier.verify(session)
236+
end
227237
end

0 commit comments

Comments
 (0)