From 0678b8a426553110e63dde3c75aaf719e74771e1 Mon Sep 17 00:00:00 2001 From: Nihad Abbasov Date: Tue, 29 Oct 2013 13:41:20 +0400 Subject: add 'Link' header for API response --- spec/requests/api/issues_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec') diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index c55025d72b5..505e9597e1b 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -25,6 +25,12 @@ describe API::API do json_response.should be_an Array json_response.first['title'].should == issue.title end + + it "should add pagination headers" do + get api("/issues?per_page=3", user) + response.headers['Link'].should == + '; rel="first", ; rel="last"' + end end end -- cgit v1.2.3