Ghost/test/unit/models/permission_spec.js
Hannah Wolfe 7f1d3ebc07
Move tests from core to root (#11700)
- move all test files from core/test to test/
- updated all imports and other references
- all code inside of core/ is then application code
- tests are correctly at the root level
- consistent with other repos/projects

Co-authored-by: Kevin Ansfield <kevin@lookingsideways.co.uk>
2020-03-30 16:26:47 +01:00

29 lines
771 B
JavaScript

const should = require('should'),
sinon = require('sinon'),
models = require('../../../core/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);
});
});
});
});