Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
typicode committed Aug 27, 2016
1 parent 61de2d8 commit 2c53d62
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/server/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ function getPage (array, page, perPage) {
}

return obj
}
}
15 changes: 7 additions & 8 deletions test/server/plural.js
Original file line number Diff line number Diff line change
Expand Up @@ -268,19 +268,18 @@ describe('Server', function () {

describe('GET /:resource?_page=&_limit=', function () {
it('should paginate with a custom limit', function (done) {
var link = [
'<http://localhost/list?_page=1&_limit=1>; rel="first"',
'<http://localhost/list?_page=1&_limit=1>; rel="prev"',
'<http://localhost/list?_page=3&_limit=1>; rel="next"',
'<http://localhost/list?_page=15&_limit=1>; 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',
[
'<http://localhost/list?_page=1&_limit=1>; rel="first"',
'<http://localhost/list?_page=1&_limit=1>; rel="prev"',
'<http://localhost/list?_page=3&_limit=1>; rel="next"',
'<http://localhost/list?_page=15&_limit=1>; rel="last"'
].join(', ')
)
.expect('link', link)
.expect('Access-Control-Expose-Headers', 'X-Total-Count')
.expect(db.list.slice(1, 2))
.expect(200, done)
Expand Down

0 comments on commit 2c53d62

Please sign in to comment.