minimongo: Test observing a query-by-ID.

Demonstrates that the optimization in PR #504 is not safe.
This commit is contained in:
David Glasser
2012-11-28 11:01:30 -08:00
parent 4acd2551e4
commit add592a32e

View File

@@ -168,6 +168,13 @@ _.each(['observe', '_observeUnordered'], function (observeMethod) {
// After calling stop, no more callbacks are called.
c.insert({_id: 5, name: "iris", tags: ["flower"]});
expect("");
// Test that observing a lookup by ID works.
handle = c.find(4)[observeMethod](makecb('b'));
expect('ab4_');
c.update(4, {$set: {eek: 5}});
expect('cb4_');
handle.stop();
});
});