mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 14:03:48 +03:00
9e96b04542
- 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
29 lines
788 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|
|
});
|