mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-03 23:00:14 -05:00
- This is a really specific piece of code related to validating models against our internal schema.js format - This doesn't make sense without a schema.js file - It does depend on the internal validator and validate tools - but those are used elsewhere too, and can reasonably be moved out of the codebase - I don't see schema.js moving out of the codebase any time soon. We can move the validator but it would be a class that requires schema via DI - For now my focus is on getting the data/validation tooling separated and making clear sense - Improving data/schema can come later :)
19 lines
628 B
JavaScript
19 lines
628 B
JavaScript
const should = require('should');
|
|
|
|
const validation = require('../../../../core/server/data/validation');
|
|
|
|
// Validate our customizations
|
|
describe('Validation', function () {
|
|
it('should export our required functions', function () {
|
|
should.exist(validation);
|
|
|
|
validation.should.have.properties(
|
|
['validate', 'validator', 'validatePassword']
|
|
);
|
|
|
|
validation.validate.should.be.a.Function();
|
|
validation.validatePassword.should.be.a.Function();
|
|
|
|
validation.validator.should.have.properties(['empty', 'notContains', 'isTimezone', 'isEmptyOrURL', 'isSlug']);
|
|
});
|
|
});
|