Bugzilla – Attachment 67376 Details for
Bug 19369
Add a helper function for translating pagination params into SQL::Abstract
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19369: Unit tests
Bug-19369-Unit-tests.patch (text/plain), 1.73 KB, created by
Tomás Cohen Arazi (tcohen)
on 2017-09-26 18:15:55 UTC
(
hide
)
Description:
Bug 19369: Unit tests
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2017-09-26 18:15:55 UTC
Size:
1.73 KB
patch
obsolete
>From 43fe61ca05e773bc557cbe2dd85abb33e753d50b Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 26 Sep 2017 15:11:38 -0300 >Subject: [PATCH] Bug 19369: Unit tests > >--- > t/Koha/REST/Plugin/Pagination.t | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > >diff --git a/t/Koha/REST/Plugin/Pagination.t b/t/Koha/REST/Plugin/Pagination.t >index 586b373..45f1bd8 100644 >--- a/t/Koha/REST/Plugin/Pagination.t >+++ b/t/Koha/REST/Plugin/Pagination.t >@@ -24,6 +24,7 @@ app->log->level('error'); > > plugin 'Koha::REST::Plugin::Pagination'; > >+# For add_pagination_headers() > > get '/empty' => sub { > my $c = shift; >@@ -48,9 +49,18 @@ get '/pagination_headers_last_page' => sub { > $c->render( json => { ok => 1 }, status => 200 ); > }; > >+# For dbic_merge_pagination >+ >+get '/dbic_merge_pagination' => sub { >+ my $c = shift; >+ my $filter = { firstname => 'Kyle', surname => 'Hall' }; >+ $filter = $c->dbic_merge_pagination({ filter => $filter, params => { _page => 1, _per_page => 3 } }); >+ $c->render( json => $filter, status => 200 ); >+}; >+ > # The tests > >-use Test::More tests => 1; >+use Test::More tests => 2; > use Test::Mojo; > > subtest 'add_pagination_headers() tests' => sub { >@@ -108,3 +118,14 @@ subtest 'add_pagination_headers() tests' => sub { > ->header_like( 'Link' => qr/<http:\/\/.*\?.*_page=4.*>; rel="last"/ ) > ->header_like( 'Link' => qr/<http:\/\/.*\?.*firstname=Jonathan.*>; rel="last"/ ); > }; >+ >+subtest 'dbic_merge_pagination() tests' => sub { >+ >+ plan tests => 3; >+ >+ my $t = Test::Mojo->new; >+ >+ $t->get_ok('/dbic_merge_pagination') >+ ->status_is(200) >+ ->json_is({ firstname => 'Kyle', surname => 'Hall', page => 1, rows => 3 }); >+}; >-- >2.7.4
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 19369
:
67376
|
67378
|
67381
|
67382
|
67544
|
67545
|
69363
|
69364