Bugzilla – Attachment 130827 Details for
Bug 30125
Add full-stack tests for API pagination
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30125: (QA follow-up) Rename variable as cities
Bug-30125-QA-follow-up-Rename-variable-as-cities.patch (text/plain), 4.49 KB, created by
Nick Clemens (kidclamp)
on 2022-02-18 12:04:42 UTC
(
hide
)
Description:
Bug 30125: (QA follow-up) Rename variable as cities
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2022-02-18 12:04:42 UTC
Size:
4.49 KB
patch
obsolete
>From e83eaef9dbadbfd8bb70eac97a649b444e222b6e Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Fri, 18 Feb 2022 12:03:46 +0000 >Subject: [PATCH] Bug 30125: (QA follow-up) Rename variable as cities > >It's what we are testing :-) >--- > t/db_dependent/api/v1/pagination.t | 28 ++++++++++++++-------------- > 1 file changed, 14 insertions(+), 14 deletions(-) > >diff --git a/t/db_dependent/api/v1/pagination.t b/t/db_dependent/api/v1/pagination.t >index c6d93caef3..83a7d2077b 100755 >--- a/t/db_dependent/api/v1/pagination.t >+++ b/t/db_dependent/api/v1/pagination.t >@@ -75,7 +75,7 @@ subtest 'list() pagination tests' => sub { > > t::lib::Mocks::mock_preference( 'RESTdefaultPageSize', 20 ); > >- my $libraries = >+ my $cities = > $t->get_ok("//$userid:$password@/api/v1/cities")->status_is(200) > ->header_is( 'X-Total-Count', '10' ) > ->header_is( 'X-Base-Total-Count', '10' ) >@@ -87,9 +87,9 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=20\&_page=1|_page=1\&_per_page=20)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 10, '10 libraries retrieved' ); >+ is( scalar @{$cities}, 10, '10 libraries retrieved' ); > >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities?q={\"name\":{\"-like\":\"\%A\"}}")->status_is(200) > ->header_is( 'X-Total-Count', '5', 'The resultset has 5 items' ) > ->header_is( 'X-Base-Total-Count', '10', 'The resultset, without the filter, has 10' ) >@@ -101,12 +101,12 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=20.*\&_page=1.*|_page=1.*\&_per_page=20.*)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 5, '5 libraries retrieved' ); >+ is( scalar @{$cities}, 5, '5 libraries retrieved' ); > > t::lib::Mocks::mock_preference( 'RESTdefaultPageSize', 3 ); > > # _per_page overrides RESTdefaultPageSize >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities?_per_page=20") > ->status_is(200) > ->header_is( 'X-Total-Count', '10' ) >@@ -119,10 +119,10 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=20\&_page=1|_page=1\&_per_page=20)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 10, '10 libraries retrieved' ); >+ is( scalar @{$cities}, 10, '10 libraries retrieved' ); > > # page 1 >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities")->status_is(200) > ->header_is( 'X-Total-Count', '10' ) > ->header_is( 'X-Base-Total-Count', '10' ) >@@ -135,11 +135,11 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=3\&_page=4|_page=4\&_per_page=3)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 3, '3 libraries retrieved' ); >+ is( scalar @{$cities}, 3, '3 libraries retrieved' ); > > # This tests X-Base-Total-Count, .* is used for q=, as we don't want > # to add all combinations to the regex >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities?_per_page=2&_page=2&q={\"name\":{\"-like\":\"\%A\"}}")->status_is(200) > ->header_is( 'X-Total-Count', '5' ) > ->header_is( 'X-Base-Total-Count', '10' ) >@@ -153,10 +153,10 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=2.*\&_page=3.*|_page=3.*\&_per_page=2.*)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 2, '2 libraries retrieved' ); >+ is( scalar @{$cities}, 2, '2 libraries retrieved' ); > > # last page, with only one result >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities?_page=4")->status_is(200) > ->header_is( 'X-Total-Count', '10' ) > ->header_is( 'X-Base-Total-Count', '10' ) >@@ -169,9 +169,9 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=3\&_page=4|_page=4\&_per_page=3)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 1, '1 library retrieved' ); >+ is( scalar @{$cities}, 1, '1 library retrieved' ); > >- $libraries = >+ $cities = > $t->get_ok("//$userid:$password@/api/v1/cities?_per_page=-1") > ->status_is(200) > ->header_is( 'X-Total-Count', '10' ) >@@ -184,7 +184,7 @@ subtest 'list() pagination tests' => sub { > qr#(_per_page=-1\&_page=1|_page=1\&_per_page=-1)>\; rel="last"# ) > ->tx->res->json; > >- is( scalar @{$libraries}, 10, '10 libraries retrieved, -1 means all' ); >+ is( scalar @{$cities}, 10, '10 libraries retrieved, -1 means all' ); > > $schema->storage->txn_rollback; > }; >-- >2.30.2
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 30125
:
130766
|
130826
|
130827
|
131100