Skip to content

Commit

Permalink
Merge pull request #272 from dgsan/master
Browse files Browse the repository at this point in the history
Adds unit test for usage of `limit` and `skip` query params.
  • Loading branch information
1602 committed Apr 18, 2013
2 parents 74ef2a6 + 57baae8 commit 4c0a0a5
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions test/basic-querying.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4c0a0a5

Please sign in to comment.