mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
- fix test: 'mongo-livedata - rewrite selector MONGO | STRING'
This commit is contained in:
@@ -2769,27 +2769,23 @@ _.each( ['STRING', 'MONGO'], function(idGeneration) {
|
||||
|
||||
}); // end idGeneration parametrization
|
||||
|
||||
Tinytest.add('mongo-livedata - rewrite selector', function (test) {
|
||||
|
||||
test.equal(Mongo.Collection._rewriteSelector('foo'),
|
||||
{_id: 'foo'});
|
||||
|
||||
Tinytest.add('mongo-livedata - rewrite selector', function(test) {
|
||||
test.equal(Mongo.Collection._rewriteSelector('foo'), { _id: 'foo' });
|
||||
|
||||
var oid = new Mongo.ObjectID();
|
||||
test.equal(Mongo.Collection._rewriteSelector(oid),
|
||||
{_id: oid});
|
||||
test.equal(Mongo.Collection._rewriteSelector(oid), { _id: oid });
|
||||
|
||||
test.matches(
|
||||
Mongo.Collection._rewriteSelector({ _id: null })._id,
|
||||
/^\S+$/,
|
||||
'Passing in a falsey selector _id should return a selector with a new '
|
||||
+ 'auto-generated _id string'
|
||||
'Passing in a falsey selector _id should return a selector with a new ' +
|
||||
'auto-generated _id string'
|
||||
);
|
||||
test.equal(
|
||||
Mongo.Collection._rewriteSelector({ _id: null }, { fallbackId: oid }),
|
||||
{ _id: oid },
|
||||
'Passing in a falsey selector _id and a fallback ID should return a '
|
||||
+ 'selector with an _id using the fallback ID'
|
||||
'Passing in a falsey selector _id and a fallback ID should return a ' +
|
||||
'selector with an _id using the fallback ID'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user