diff --git a/src/server/utils.js b/src/server/utils.js index 079d67e..8f8307a 100644 --- a/src/server/utils.js +++ b/src/server/utils.js @@ -49,4 +49,4 @@ function getPage (array, page, perPage) { } return obj -} \ No newline at end of file +} diff --git a/test/server/plural.js b/test/server/plural.js index 5ba34db..cf55b24 100644 --- a/test/server/plural.js +++ b/test/server/plural.js @@ -268,19 +268,18 @@ describe('Server', function () { describe('GET /:resource?_page=&_limit=', function () { it('should paginate with a custom limit', function (done) { + var link = [ + '; rel="first"', + '; rel="prev"', + '; rel="next"', + '; rel="last"' + ].join(', ') request(server) .get('/list?_page=2&_limit=1') .set('host', 'localhost') .expect('Content-Type', /json/) .expect('x-total-count', db.list.length.toString()) - .expect('link', - [ - '; rel="first"', - '; rel="prev"', - '; rel="next"', - '; rel="last"' - ].join(', ') - ) + .expect('link', link) .expect('Access-Control-Expose-Headers', 'X-Total-Count') .expect(db.list.slice(1, 2)) .expect(200, done)