water-orm
Version:
A monolith version of Standalone waterline ORM
44 lines (34 loc) • 1.06 kB
JavaScript
var Waterline = require('../../../../lib/waterline'),
assert = require('assert');
describe('Core Schema', function() {
describe('with validation properties', function() {
var person;
before(function(done) {
var waterline = new Waterline();
var Person = Waterline.Collection.extend({
identity: 'person',
connection: 'foo',
attributes: {
first_name: {
type: 'STRING',
length: { min: 2, max: 10 }
}
}
});
waterline.loadCollection(Person);
var connections = {
'foo': {
adapter: 'foobar'
}
};
waterline.initialize({ adapters: { foobar: {} }, connections: connections }, function(err, colls) {
if(err) return done(err);
person = colls.collections.person;
done();
});
});
it('should ignore validation properties in the schema', function() {
assert(!person._schema.schema.first_name.length);
});
});
});