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
diff options
context:
space:
mode:
authorToon Claes <toon@iotcl.com>2017-08-17 18:56:01 +0300
committerToon Claes <toon@iotcl.com>2017-08-17 22:47:01 +0300
commite17d9529faa4d292d7f869a0f9ebbbcde4cc6f9e (patch)
tree18a73c81e978dfb2828f38d793f35e1e7da55d77 /spec/lib/api
parenta98d17a83877cd885a92aac29a9cb13d13a53a86 (diff)
Total Pages should be at least one
And the link to the last page cannot be `page=0`.
Diffstat (limited to 'spec/lib/api')
-rw-r--r--spec/lib/api/helpers/pagination_spec.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/lib/api/helpers/pagination_spec.rb b/spec/lib/api/helpers/pagination_spec.rb
index 041c40d9490..59deca7757b 100644
--- a/spec/lib/api/helpers/pagination_spec.rb
+++ b/spec/lib/api/helpers/pagination_spec.rb
@@ -107,7 +107,7 @@ describe API::Helpers::Pagination do
it 'adds appropriate headers' do
expect_header('X-Total', '0')
- expect_header('X-Total-Pages', '0')
+ expect_header('X-Total-Pages', '1')
expect_header('X-Per-Page', '2')
expect_header('X-Page', '1')
expect_header('X-Next-Page', '')
@@ -118,6 +118,7 @@ describe API::Helpers::Pagination do
expect(val).to include('rel="last"')
expect(val).not_to include('rel="prev"')
expect(val).not_to include('rel="next"')
+ expect(val).not_to include('page=0')
end
subject.paginate(resource)