diff --git a/test/db.test.js b/test/db.test.js index a09c815..deb7dff 100644 --- a/test/db.test.js +++ b/test/db.test.js @@ -979,7 +979,7 @@ describe('Database', function () { }); // ==== End of 'Update' ==== // - describe.only('Remove', function () { + describe('Remove', function () { it('Can remove multiple documents', function (done) { var id1, id2, id3; @@ -1124,6 +1124,31 @@ describe('Database', function () { }); }); }); + + it('Can remove without the options arg (will use defaults then)', function (done) { + d.insert({ a:1, hello: 'world' }, function (err, doc1) { + d.insert({ a:2, hello: 'earth' }, function (err, doc2) { + d.insert({ a:5, hello: 'pluton' }, function (err, doc3) { + d.remove({ a: 2 }, function (err, nr) { + assert.isNull(err); + nr.should.equal(1); + d.find({}, function (err, docs) { + var d1 = _.find(docs, function (doc) { return doc._id === doc1._id }) + , d2 = _.find(docs, function (doc) { return doc._id === doc2._id }) + , d3 = _.find(docs, function (doc) { return doc._id === doc3._id }) + ; + + d1.a.should.equal(1); + assert.isUndefined(d2); + d3.a.should.equal(5); + + done(); + }); + }); + }); + }); + }); + }); }); // ==== End of 'Remove' ==== //