Remove dependency on raw mongo from SchemaRouter.delete.

This commit is contained in:
Nikita Lutsenko
2016-02-29 17:04:38 -08:00
parent d7b1184b5e
commit 028ef2a7b2
4 changed files with 50 additions and 66 deletions

View File

@@ -396,7 +396,7 @@ describe('schemas', () => {
})
});
it('refuses to delete non-existant fields', done => {
it('refuses to delete non-existent fields', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -406,13 +406,13 @@ describe('schemas', () => {
json: true,
body: {
fields: {
nonExistantKey: {__op: "Delete"},
nonExistentKey: {__op: "Delete"},
}
}
}, (error, response, body) => {
expect(response.statusCode).toEqual(400);
expect(body.code).toEqual(255);
expect(body.error).toEqual('field nonExistantKey does not exist, cannot delete');
expect(body.error).toEqual('field nonExistentKey does not exist, cannot delete');
done();
});
});
@@ -660,7 +660,8 @@ describe('schemas', () => {
}, (error, response, body) => {
expect(response.statusCode).toEqual(400);
expect(body.code).toEqual(255);
expect(body.error).toEqual('class HasAllPOD not empty, contains 1 objects, cannot drop schema');
expect(body.error).toMatch(/HasAllPOD/);
expect(body.error).toMatch(/contains 1/);
done();
});
});