Skip to content

Commit

Permalink
Added simple chanining find/limit test
Browse files Browse the repository at this point in the history
  • Loading branch information
christkv committed Jul 10, 2011
1 parent f4a2867 commit 505ead9
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions test/find_test.js
Expand Up @@ -713,9 +713,22 @@ var tests = testCase({
test.done();
});
});
});

});
});
},

'Should correctly handle chained skip and limit on find with toArray' : function(test) {
client.createCollection('skipAndLimitOnFindWithToArray', function(err, collection) {
collection.insert([{a:1}, {b:2}, {c:3}], {safe:true}, function(err, result) {

collection.find().skip(1).limit(1).toArray(function(err, items) {
test.equal(null, err);
test.equal(1, items.length);
test.equal(2, items[0].b)
test.done();
})
});
});
}
})

Expand Down

0 comments on commit 505ead9

Please sign in to comment.