Add a deleteById test
This commit is contained in:
parent
345435e7b2
commit
267f94c542
|
@ -192,7 +192,21 @@ describe('Model', function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe('Model.destroyAll(callback)', 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())
|
||||
.task(User, 'create', {first: 'jill'})
|
||||
|
|
Loading…
Reference in New Issue