2018-06-02 21:48:23 +02:00
|
|
|
var should = require('should'),
|
2017-03-21 08:24:11 +00:00
|
|
|
sinon = require('sinon'),
|
2016-05-19 13:49:22 +02:00
|
|
|
rewire = require('rewire'),
|
|
|
|
Promise = require('bluebird'),
|
2020-03-30 16:26:47 +01:00
|
|
|
postScheduling = require('../../../../core/server/adapters/scheduling/post-scheduling');
|
2016-05-19 13:49:22 +02:00
|
|
|
|
|
|
|
describe('Scheduling', function () {
|
|
|
|
var scope = {};
|
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|