0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-20 22:42:53 -05:00

Fixes admin session cookie test

- 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.
This commit is contained in:
Harry Wolff 2014-01-02 21:06:23 -05:00
parent 75b261cd69
commit 20055157ef

View file

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