mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Tests: Fixed listeners_spec.js (DST)
closes #9188 - make timezone offsets dynamic, yey!
This commit is contained in:
parent
17e18d7431
commit
97beaf0c1b
1 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
||||||
var should = require('should'), // jshint ignore:line
|
var should = require('should'), // jshint ignore:line
|
||||||
sinon = require('sinon'),
|
sinon = require('sinon'),
|
||||||
Promise = require('bluebird'),
|
Promise = require('bluebird'),
|
||||||
moment = require('moment'),
|
moment = require('moment-timezone'),
|
||||||
rewire = require('rewire'),
|
rewire = require('rewire'),
|
||||||
_ = require('lodash'),
|
_ = require('lodash'),
|
||||||
config = require('../../../../server/config'),
|
config = require('../../../../server/config'),
|
||||||
|
@ -155,7 +155,7 @@ describe('Models: listeners', function () {
|
||||||
* The post should be still scheduled for 8PM UTC time.
|
* The post should be still scheduled for 8PM UTC time.
|
||||||
* So the database UTC string must be 2017-04-19 20:00:00.
|
* So the database UTC string must be 2017-04-19 20:00:00.
|
||||||
*/
|
*/
|
||||||
scope.timezoneOffset = 180;
|
scope.timezoneOffset = moment.tz.zone('Etc/UTC').offset(now) - moment.tz.zone('Asia/Baghdad').offset(now);
|
||||||
scope.oldTimezone = 'Asia/Baghdad';
|
scope.oldTimezone = 'Asia/Baghdad';
|
||||||
scope.newTimezone = 'Etc/UTC';
|
scope.newTimezone = 'Etc/UTC';
|
||||||
|
|
||||||
|
@ -212,7 +212,7 @@ describe('Models: listeners', function () {
|
||||||
* The post should be still scheduled for 8PM UTC time.
|
* The post should be still scheduled for 8PM UTC time.
|
||||||
* So the database UTC string must be 2017-04-18 11:00:00.
|
* So the database UTC string must be 2017-04-18 11:00:00.
|
||||||
*/
|
*/
|
||||||
scope.timezoneOffset = -420;
|
scope.timezoneOffset = moment.tz.zone('Asia/Seoul').offset(now) - moment.tz.zone('Europe/Amsterdam').offset(now);
|
||||||
scope.oldTimezone = 'Europe/Amsterdam';
|
scope.oldTimezone = 'Europe/Amsterdam';
|
||||||
scope.newTimezone = 'Asia/Seoul';
|
scope.newTimezone = 'Asia/Seoul';
|
||||||
|
|
||||||
|
@ -277,7 +277,7 @@ describe('Models: listeners', function () {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
scope.timezoneOffset = -180;
|
scope.timezoneOffset = moment.tz.zone('Asia/Baghdad').offset(now) - moment.tz.zone('Etc/UTC').offset(now);
|
||||||
scope.oldTimezone = 'Asia/Baghdad';
|
scope.oldTimezone = 'Asia/Baghdad';
|
||||||
scope.newTimezone = 'Etc/UTC';
|
scope.newTimezone = 'Etc/UTC';
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue