Skip to content

Commit

Permalink
another test for $unset
Browse files Browse the repository at this point in the history
  • Loading branch information
aheckmann committed Nov 21, 2011
1 parent f3db3ea commit 6e414b2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion test/model.querying.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,6 @@ module.exports = {
b.save(function (err) {
should.strictEqual(null, err);
B.findById(b._id, function (err, b) {
db.close();
should.strictEqual(null, err);
should.strictEqual(undefined, b.title);
should.strictEqual(null, b.author);
Expand All @@ -1225,6 +1224,16 @@ module.exports = {
should.strictEqual(undefined, b.comments[0].body);
b.comments[1].title.should.equal('turkey');
b.comments[1].body.should.equal('cranberries');

b.meta = undefined;
b.save(function (err) {
should.strictEqual(null, err);
B.collection.findOne({ _id: b._id}, function (err, b) {
db.close();
should.strictEqual(null, err);
should.strictEqual(undefined, b.meta);
});
});
});
});
});
Expand Down

0 comments on commit 6e414b2

Please sign in to comment.