From e17d9529faa4d292d7f869a0f9ebbbcde4cc6f9e Mon Sep 17 00:00:00 2001 From: Toon Claes Date: Thu, 17 Aug 2017 17:56:01 +0200 Subject: Total Pages should be at least one And the link to the last page cannot be `page=0`. --- spec/lib/api/helpers/pagination_spec.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'spec/lib/api') 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) -- cgit v1.2.1