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:
parent
a7d5682d16
commit
c9500b11ea
1 changed files with 3 additions and 2 deletions
|
@ -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'));
|
||||
|
|
Loading…
Add table
Reference in a new issue