2016-05-19 13:49:22 +02:00
|
|
|
|
|
|
|
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());
|
2016-09-13 17:41:14 +02:00
|
|
|
scope.scheduling = rewire(config.get('paths').corePath + '/server/scheduling');
|
2016-05-19 13:49:22 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|