2020-04-29 16:44:27 +01:00
|
|
|
const should = require('should');
|
|
|
|
const sinon = require('sinon');
|
|
|
|
const rewire = require('rewire');
|
|
|
|
const Promise = require('bluebird');
|
|
|
|
const postScheduling = require('../../../../core/server/adapters/scheduling/post-scheduling');
|
2016-05-19 13:49:22 +02:00
|
|
|
|
|
|
|
describe('Scheduling', function () {
|
2020-04-29 16:44:27 +01:00
|
|
|
const scope = {};
|
2016-05-19 13:49:22 +02:00
|
|
|
|
|
|
|
before(function () {
|
2019-01-21 17:53:44 +01:00
|
|
|
sinon.stub(postScheduling, 'init').returns(Promise.resolve());
|
2020-03-30 16:26:47 +01:00
|
|
|
scope.scheduling = rewire('../../../../core/server/adapters/scheduling');
|
2016-05-19 13:49:22 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
after(function () {
|
2019-01-21 17:53:44 +01:00
|
|
|
sinon.restore();
|
2016-05-19 13:49:22 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|