Skip to content

Commit

Permalink
tests; added for Automattic#1210
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Nov 14, 2012
1 parent 1849d74 commit 62388c9
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/model.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(){
Expand Down

0 comments on commit 62388c9

Please sign in to comment.