Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-31 14:46:57 +0400
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-03-31 14:46:57 +0400
commit046fa9bdb106f4a94b3f62646726e99923e75b0a (patch)
treec55739c4e6cd82a900a83fa4b3478d111f4d129e /spec
parent8769b7ab9774c0daa040f114e604141ad294e0e2 (diff)
parent0678b8a426553110e63dde3c75aaf719e74771e1 (diff)
Merge pull request #5469 from NARKOZ/api-pagination-headers
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 e9422cd2643..0b4f22bfb3d 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