Bugzilla – Attachment 105250 Details for
Bug 25570
Listing requests should be paginated by default
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25570: (follow-up) Fix tests
Bug-25570-follow-up-Fix-tests.patch (text/plain), 2.04 KB, created by
Jonathan Druart
on 2020-05-22 07:59:26 UTC
(
hide
)
Description:
Bug 25570: (follow-up) Fix tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-05-22 07:59:26 UTC
Size:
2.04 KB
patch
obsolete
>From 607f06fd1b881b103e6cef8fc96eaeec16a6d469 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 21 May 2020 18:25:46 -0300 >Subject: [PATCH] Bug 25570: (follow-up) Fix tests > >This patch fixes the libraries tests, that expected the old behaviour > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/api/v1/libraries.t >=> FAIL: Tests fail >2. Apply this patch >3. Repeat 1 >=> SUCCESS: Tests pass! >4. Sign off :-D > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/db_dependent/api/v1/libraries.t | 13 ++++++++----- > 1 file changed, 8 insertions(+), 5 deletions(-) > >diff --git a/t/db_dependent/api/v1/libraries.t b/t/db_dependent/api/v1/libraries.t >index c6e9cdffbe..3a04838762 100644 >--- a/t/db_dependent/api/v1/libraries.t >+++ b/t/db_dependent/api/v1/libraries.t >@@ -24,6 +24,8 @@ use Test::Warn; > use t::lib::TestBuilder; > use t::lib::Mocks; > >+use List::Util qw(min); >+ > use Koha::Libraries; > use Koha::Database; > >@@ -35,7 +37,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); > my $t = Test::Mojo->new('Koha::REST::V1'); > > subtest 'list() tests' => sub { >- plan tests => 8; >+ plan tests => 7; > > $schema->storage->txn_begin; > >@@ -54,12 +56,13 @@ subtest 'list() tests' => sub { > $another_library = $builder->build_object({ class => 'Koha::Libraries', value => $another_library }); > > ## Authorized user tests >- my $count_of_libraries = Koha::Libraries->search->count; > # Make sure we are returned with the correct amount of libraries > $t->get_ok( "//$userid:$password@/api/v1/libraries" ) >- ->status_is( 200, 'SWAGGER3.2.2' ) >- ->json_has('/'.($count_of_libraries-1).'/library_id') >- ->json_hasnt('/'.($count_of_libraries).'/library_id'); >+ ->status_is( 200, 'SWAGGER3.2.2' ); >+ >+ my $response_count = scalar @{ $t->tx->res->json }; >+ my $expected_count = min( Koha::Libraries->count, C4::Context->preference('RESTdefaultPageSize') ); >+ is( $response_count, $expected_count, 'Results count is paginated'); > > subtest 'query parameters' => sub { > >-- >2.20.1
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 25570
:
105229
|
105230
|
105231
|
105248
|
105249
|
105250
|
106070
|
106071
|
106072
|
106277