Ghost/test/unit/server/models/permission.test.js
Hannah Wolfe 9e96b04542
Moved server unit tests into the server folder
- this is a small part of a bit of cleanup of our test files
- the goal is to make the existing tests clearer with a view to making it easier to write more tests
- this makes the test structure follow the codebase structure more closely
- eventually we will colocate the tests as we break the codebase down further
2021-10-06 12:01:09 +01:00

29 lines
788 B
JavaScript

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