summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorNihad Abbasov <narkoz.2008@gmail.com>2013-10-29 13:41:20 +0400
committerNihad Abbasov <narkoz.2008@gmail.com>2013-10-29 13:41:20 +0400
commit0678b8a426553110e63dde3c75aaf719e74771e1 (patch)
tree0a6d1e5f03e841f798eb7bfc225fd5f3d7b010df /spec
parentff7073ac23afdf5873f0b5eaee54b9c735e7e04d (diff)
downloadgitlab-ce-0678b8a426553110e63dde3c75aaf719e74771e1.tar.gz
add 'Link' header for API response
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/issues_spec.rb6
1 files changed, 6 insertions, 0 deletions
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 ==
+ '<http://www.example.com/api/v3/issues?page=1&per_page=3>; rel="first", <http://www.example.com/api/v3/issues?page=1&per_page=3>; rel="last"'
+ end
end
end