mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 11:22:19 +03:00
0ae0a0b490
refs #6982 - a replace for all config usages - always use config.get or config.set - this a pure replacement, no logic has changed [ci skip]
33 lines
986 B
JavaScript
33 lines
986 B
JavaScript
|
|
var sinon = require('sinon'),
|
|
rewire = require('rewire'),
|
|
/*jshint unused:false*/
|
|
should = require('should'),
|
|
Promise = require('bluebird'),
|
|
config = require(__dirname + '/../../../server/config'),
|
|
postScheduling = require(__dirname + '/../../../server/scheduling/post-scheduling');
|
|
|
|
describe('Scheduling', function () {
|
|
var scope = {};
|
|
|
|
before(function () {
|
|
sinon.stub(postScheduling, 'init').returns(Promise.resolve());
|
|
scope.scheduling = rewire(config.get('paths').corePath + '/server/scheduling');
|
|
});
|
|
|
|
after(function () {
|
|
postScheduling.init.restore();
|
|
});
|
|
|
|
describe('success', function () {
|
|
it('ensure post scheduling init is called', function (done) {
|
|
scope.scheduling.init({
|
|
postScheduling: {}
|
|
}).then(function () {
|
|
postScheduling.init.calledOnce.should.eql(true);
|
|
done();
|
|
}).catch(done);
|
|
});
|
|
});
|
|
});
|