Add a deleteById test

This commit is contained in:
Raymond Feng 2013-07-22 10:00:07 -07:00
parent 345435e7b2
commit 267f94c542
1 changed files with 15 additions and 1 deletions

View File

@ -192,6 +192,20 @@ describe('Model', function() {
});
});
describe('Model.deleteById([callback])', function () {
it("Delete a model instance from the attached data source", function (done) {
User.create({first: 'joe', last: 'bob'}, function (err, user) {
User.deleteById(user.id, function (err) {
User.findById(user.id, function (err, notFound) {
assert(!err);
assert.equal(notFound, null);
done();
});
});
});
});
});
describe('Model.destroyAll(callback)', function() {
it("Delete all Model instances from data source", function(done) {
(new TaskEmitter())