Adds test for limit and skip + limit on `all()` queries as in docs.

(Currently not all adapters may pass.)
This commit is contained in:
dgsan 2013-04-18 09:15:07 -07:00 committed by Raymond Feng
parent 83027f9ead
commit 1a91605340
1 changed files with 18 additions and 0 deletions

View File

@ -60,6 +60,24 @@ describe('basic-querying', function() {
done();
});
});
it('should query limited collection', function(done) {
User.all({limit: 3}, function(err, users) {
should.exists(users);
should.not.exists(err);
users.should.have.lengthOf(3);
done();
});
});
it('should query offset collection with limit', function(done) {
User.all({skip: 1, limit: 4}, function(err, users) {
should.exists(users);
should.not.exists(err);
users.should.have.lengthOf(4);
done();
});
});
it('should query filtered collection', function(done) {
User.all({where: {role: 'lead'}}, function(err, users) {