Bugzilla – Attachment 106070 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: Regression tests
Bug-25570-Regression-tests.patch (text/plain), 2.32 KB, created by
Martin Renvoize (ashimema)
on 2020-06-19 11:45:56 UTC
(
hide
)
Description:
Bug 25570: Regression tests
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2020-06-19 11:45:56 UTC
Size:
2.32 KB
patch
obsolete
>From fdc308f9ebcd9db24050afeb8e677b27204912bc Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Thu, 21 May 2020 17:48:21 -0300 >Subject: [PATCH] Bug 25570: Regression tests > >This tests verify that the default behaviour is to paginate the results. > >To test: >1. Apply this patch >2. Run: > $ kshell > k$ prove t/db_dependent/Koha/REST/Plugin/Objects.t >=> FAIL: $c->objects->search doesn't paginate results by default > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/db_dependent/Koha/REST/Plugin/Objects.t | 24 +++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > >diff --git a/t/db_dependent/Koha/REST/Plugin/Objects.t b/t/db_dependent/Koha/REST/Plugin/Objects.t >index 1d726ce708..e816e32843 100644 >--- a/t/db_dependent/Koha/REST/Plugin/Objects.t >+++ b/t/db_dependent/Koha/REST/Plugin/Objects.t >@@ -80,6 +80,7 @@ get '/biblios' => sub { > use Test::More tests => 9; > use Test::Mojo; > >+use t::lib::Mocks; > use t::lib::TestBuilder; > use Koha::Database; > >@@ -90,7 +91,7 @@ my $builder = t::lib::TestBuilder->new; > > subtest 'objects.search helper' => sub { > >- plan tests => 38; >+ plan tests => 44; > > $schema->storage->txn_begin; > >@@ -172,6 +173,25 @@ subtest 'objects.search helper' => sub { > ->json_is('/2/name' => 'Manuelab') > ->json_is('/3/name' => 'Emanuel'); > >+ # Add 20 more cities >+ for ( 1..20 ) { >+ $builder->build_object({ class => 'Koha::Cities' }); >+ } >+ >+ t::lib::Mocks::mock_preference('RESTdefaultPageSize', 20 ); >+ $t->get_ok('/cities') >+ ->status_is(200); >+ >+ my $response_count = scalar @{ $t->tx->res->json }; >+ is( $response_count, 20, 'RESTdefaultPageSize is honoured by default (20)' ); >+ >+ t::lib::Mocks::mock_preference('RESTdefaultPageSize', 5 ); >+ $t->get_ok('/cities') >+ ->status_is(200); >+ >+ $response_count = scalar @{ $t->tx->res->json }; >+ is( $response_count, 5, 'RESTdefaultPageSize is honoured by default (5)' ); >+ > $schema->storage->txn_rollback; > }; > >@@ -363,4 +383,4 @@ subtest 'object.search helper order by embedded columns' => sub { > ->json_is('/biblios/1/biblio_id' => $biblio1->biblionumber, 'Biblio 1 should be second'); > > $schema->storage->txn_begin; >-} >\ No newline at end of file >+} >-- >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