Ghost/core/test/unit/models/permission_spec.js

29 lines
766 B
JavaScript
Raw Normal View History

const should = require('should'),
sinon = require('sinon'),
models = require('../../../server/models'),
testUtils = require('../../utils'),
configUtils = require('../../utils/configUtils');
describe('Unit: models/permission', function () {
before(function () {
models.init();
});
after(function () {
sinon.restore();
configUtils.restore();
});
describe('add', function () {
it('[error] validation', function () {
return models.Permission.add({})
.then(function () {
'Should fail'.should.be.true();
})
.catch(function (err) {
err.length.should.eql(3);
});
});
});
});