0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-04-08 02:52:39 -05:00

🐛 Set timezone in time related tests (#8214)

closes #8017

- set the timezone, and use moment.tz to get the time now
This commit is contained in:
Hannah Wolfe 2017-03-23 12:58:50 +00:00 committed by Katharina Irrgang
parent a7d5682d16
commit c9500b11ea

View file

@ -2,7 +2,7 @@
var should = require('should'),
sinon = require('sinon'),
_ = require('lodash'),
moment = require('moment'),
moment = require('moment-timezone'),
utils = require('../../../server/utils'),
settingsCache = require('../../../server/settings/cache'),
configUtils = require('../../utils/configUtils'),
@ -505,10 +505,11 @@ describe('Url', function () {
});
it('post is not published yet', function () {
localSettingsCache.activeTimezone = 'Europe/London';
localSettingsCache.permalinks = '/:year/:month/:day/:slug/';
var testData = _.merge(testUtils.DataGenerator.Content.posts[2], {id: 3, published_at: null}),
nowMoment = moment(),
nowMoment = moment().tz('Europe/London'),
postLink = '/YYYY/MM/DD/short-and-sweet/';
postLink = postLink.replace('YYYY', nowMoment.format('YYYY'));