Ghost/core/test/unit/scheduling/index_spec.js
Hannah Wolfe 47e00900cc 💄 🐷 Test consistency (#8199)
no issue

- change out should.equal for // jshint ignore:line
- ensure should is the first require in every test, and ALWAYS require
- make sinon the second require, and sandbox the last thing
- ALWAYS use sandbox, futureproofs tests against contributors who don't know it
- change require formatting
2017-03-21 09:24:11 +01:00

33 lines
1008 B
JavaScript

var should = require('should'), // jshint ignore:line
sinon = require('sinon'),
rewire = require('rewire'),
Promise = require('bluebird'),
config = require(__dirname + '/../../../server/config'),
postScheduling = require(__dirname + '/../../../server/scheduling/post-scheduling'),
sandbox = sinon.sandbox.create();
describe('Scheduling', function () {
var scope = {};
before(function () {
sandbox.stub(postScheduling, 'init').returns(Promise.resolve());
scope.scheduling = rewire(config.get('paths').corePath + '/server/scheduling');
});
after(function () {
sandbox.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);
});
});
});