mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-07 03:22:21 +03:00
e2cee5be66
closes #1396 - moved core/test/unit/api* to core/test/integration/api/ - moved core/test/integration/model* to core/test/integration/model/ - moved core/test/unit/utils to core/test/utils - moved core/test/unit/fixtures to core/test/utils/fixtures/ - changed gruntfile.js to execute api tests with target 'integration'
61 lines
1.7 KiB
JavaScript
61 lines
1.7 KiB
JavaScript
/*globals describe, beforeEach, afterEach, before, it*/
|
|
var testUtils = require('../utils'),
|
|
should = require('should'),
|
|
sinon = require('sinon'),
|
|
_ = require("underscore"),
|
|
when = require('when'),
|
|
knex = require('../../server/models/base').Knex,
|
|
errors = require('../../server/errorHandling'),
|
|
|
|
// Stuff we are testing
|
|
plugins = require('../../server/plugins'),
|
|
GhostPlugin = plugins.GhostPlugin,
|
|
loader = require('../../server/plugins/loader');
|
|
describe('Plugins', function () {
|
|
|
|
var sandbox;
|
|
|
|
before(function (done) {
|
|
testUtils.clearData().then(function () {
|
|
done();
|
|
}, done);
|
|
});
|
|
|
|
beforeEach(function (done) {
|
|
sandbox = sinon.sandbox.create();
|
|
|
|
testUtils.initData().then(function () {
|
|
done();
|
|
}, done);
|
|
});
|
|
|
|
afterEach(function (done) {
|
|
sandbox.restore();
|
|
|
|
testUtils.clearData().then(function () {
|
|
done();
|
|
}, done);
|
|
});
|
|
|
|
describe('GhostPlugin Class', function () {
|
|
|
|
should.exist(GhostPlugin);
|
|
|
|
it('sets app instance', function () {
|
|
var fakeGhost = {fake: true},
|
|
plugin = new GhostPlugin(fakeGhost);
|
|
|
|
plugin.app.should.equal(fakeGhost);
|
|
});
|
|
|
|
it('has default install, uninstall, activate and deactivate methods', function () {
|
|
var fakeGhost = {fake: true},
|
|
plugin = new GhostPlugin(fakeGhost);
|
|
|
|
_.isFunction(plugin.install).should.equal(true);
|
|
_.isFunction(plugin.uninstall).should.equal(true);
|
|
_.isFunction(plugin.activate).should.equal(true);
|
|
_.isFunction(plugin.deactivate).should.equal(true);
|
|
});
|
|
});
|
|
}); |