Added a test on modification of upserted document

pull/2/head
Louis Chatriot 11 years ago
parent f70a86dd87
commit b449a10bed
  1. 9
      test/db.test.js

@ -915,7 +915,14 @@ describe('Database', function () {
docs.length.should.equal(1); // Default option for upsert is false
docs[0].something.should.equal("created ok");
done();
// Modifying the returned upserted document doesn't modify the database
newDoc.newField = true;
d.find({}, function (err, docs) {
docs[0].something.should.equal("created ok");
assert.isUndefined(docs[0].newField);
done();
});
});
});
});

Loading…
Cancel
Save