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:
parent
75b261cd69
commit
20055157ef
1 changed files with 1 additions and 1 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue