Bugzilla – Attachment 107836 Details for
Bug 26143
The API does not handle requesting all resources
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26143: The API is always paginated
Bug-26143-The-API-is-always-paginated.patch (text/plain), 2.64 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-08-05 15:25:51 UTC
(
hide
)
Description:
Bug 26143: The API is always paginated
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-08-05 15:25:51 UTC
Size:
2.64 KB
patch
obsolete
>From b0b421b1c682d8f162e1b89603ecbb4696a199a1 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 5 Aug 2020 11:55:28 -0300 >Subject: [PATCH] Bug 26143: The API is always paginated > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/Koha/REST/Plugin/Pagination.t | 21 +++++++++++++++------ > 1 file changed, 15 insertions(+), 6 deletions(-) > >diff --git a/t/Koha/REST/Plugin/Pagination.t b/t/Koha/REST/Plugin/Pagination.t >index 43e9f072f2..adf3001c4f 100644 >--- a/t/Koha/REST/Plugin/Pagination.t >+++ b/t/Koha/REST/Plugin/Pagination.t >@@ -66,7 +66,7 @@ get '/pagination_headers_without_page_size' => sub { > > get '/pagination_headers_without_page' => sub { > my $c = shift; >- $c->add_pagination_headers({ total => 10, params => { _per_page => 4, firstname => 'Jonathan' } }); >+ $c->add_pagination_headers({ total => 10, params => { _per_page => 3, firstname => 'Jonathan' } }); > $c->render( json => { ok => 1 }, status => 200 ); > }; > >@@ -79,7 +79,7 @@ use t::lib::Mocks; > > subtest 'add_pagination_headers() tests' => sub { > >- plan tests => 64; >+ plan tests => 75; > > my $t = Test::Mojo->new; > >@@ -151,10 +151,19 @@ subtest 'add_pagination_headers() tests' => sub { > > $t->get_ok('/pagination_headers_without_page') > ->status_is( 200 ) >- ->header_is( 'X-Total-Count' => undef, 'X-Total-Count header absent' ) >- ->header_is( 'Link' => undef, 'Link header absent' ); >- >- >+ ->header_is( 'X-Total-Count' => 10, 'X-Total-Count header present, even without page param' ) >+ ->header_unlike( 'Link' => qr/<http:\/\/.*\?.*per_page=3.*>; rel="prev",/, 'First page, no previous' ) >+ ->header_unlike( 'Link' => qr/<http:\/\/.*\?.*page=1.*>; rel="prev",/, 'First page, no previous' ) >+ ->header_unlike( 'Link' => qr/<http:\/\/.*\?.*firstname=Jonathan.*>; rel="prev",/, 'First page, no previous' ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*per_page=3.*>; rel="next",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*page=3.*>; rel="next",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*firstname=Jonathan.*>; rel="next",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*per_page=3.*>; rel="first",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*page=1.*>; rel="first",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*firstname=Jonathan.*>; rel="first",/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*per_page=3.*>; rel="last"/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*page=4.*>; rel="last"/ ) >+ ->header_like( 'Link' => qr/<http:\/\/.*\?.*firstname=Jonathan.*>; rel="last"/ ); > }; > > subtest 'dbic_merge_pagination() tests' => sub { >-- >2.28.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 26143
:
107836
|
107837
|
107838
|
107839
|
107840
|
107841