Skip to content

Commit

Permalink
Adds test for links().
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsubrian committed Oct 10, 2012
1 parent 1b57e9c commit aa925d3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
describe('links', function(){
describe('.links(obj)', function(){
it('should set Link header field', function(){
var res = response();

res.links({
next: 'http://api.example.com/users?page=2',
last: 'http://api.example.com/users?page=5'
});

var link = res.get('link');
assert.equal(link, '<http://api.example.com/users?page=2>; rel="next", ' +
'<http://api.example.com/users?page=5>; rel="last"');
});
});
});

0 comments on commit aa925d3

Please sign in to comment.