From 20055157effe9ddec1a4230bee283c1dea3023f8 Mon Sep 17 00:00:00 2001 From: Harry Wolff Date: Thu, 2 Jan 2014 21:06:23 -0500 Subject: [PATCH] Fixes admin session cookie test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Currently the test is taking the response date which is in UTC and passes it through moment() which by default parses input as local time. We then add 12 hours to this now local time and when compared against the response set-cookie header the time spread is wrong. - To fix we’re parsing the response date with moment.utc which parses the date in UTC. --- core/test/functional/routes/admin_test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/test/functional/routes/admin_test.js b/core/test/functional/routes/admin_test.js index 06f9516ea8..ea0b1cd34a 100644 --- a/core/test/functional/routes/admin_test.js +++ b/core/test/functional/routes/admin_test.js @@ -64,7 +64,7 @@ describe('Admin Routing', function () { var expires; // Session should expire 12 hours after the time in the date header - expires = moment(res.headers.date).add('Hours', 12).format("ddd, DD MMM YYYY HH:mm"); + expires = moment.utc(res.headers.date).add('Hours', 12).format("ddd, DD MMM YYYY HH:mm"); expires = new RegExp("Expires=" + expires); res.headers['set-cookie'].should.match(expires);