Update the tests

This commit is contained in:
Ilya Diallo
2016-02-22 16:45:41 +01:00
parent 170dd40d3c
commit 831c2ee3de
2 changed files with 44 additions and 1 deletions

View File

@@ -32,6 +32,17 @@ describe('Schema', () => {
});
});
it('can validate one object with dot notation', (done) => {
config.database.loadSchema().then((schema) => {
return schema.validateObject('TestObjectWithSubDoc', {x: false, y: 'YY', z: 1, 'aObject.k1': 'newValue'});
}).then((schema) => {
done();
}, (error) => {
fail(error);
done();
});
});
it('can validate two objects in a row', (done) => {
config.database.loadSchema().then((schema) => {
return schema.validateObject('Foo', {x: true, y: 'yyy', z: 0});