Permalink
Browse files

tests; added for #1210

  • Loading branch information...
1 parent 1849d74 commit 62388c9f919982fface04930cd568e557cba5fb7 @aheckmann aheckmann committed Nov 14, 2012
Showing with 24 additions and 0 deletions.
  1. +24 −0 test/model.test.js
View
@@ -1697,6 +1697,30 @@ describe('model', function(){
});
});
});
+
+ describe('when called multiple times', function(){
+ it('always executes the passed callback gh-1210', function(done){
+ var db = start()
+ , collection = 'blogposts_' + random()
+ , BlogPost = db.model('BlogPost', collection)
+ , post = new BlogPost();
+
+ post.save(function (err) {
+ assert.ifError(err);
+
+ var pending = 2;
+
+ post.remove(function () {
+ if (--pending) return;
+ done();
+ });
+ post.remove(function () {
+ if (--pending) return;
+ done();
+ });
+ });
+ })
+ })
});
describe('getters', function(){

0 comments on commit 62388c9

Please sign in to comment.