Bugzilla – Attachment 83184 Details for
Bug 21460
Filtering ILL requests on borrowernumber does not work
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21460: Add tests
Bug-21460-Add-tests.patch (text/plain), 2.41 KB, created by
Jonathan Druart
on 2018-12-13 20:06:23 UTC
(
hide
)
Description:
Bug 21460: Add tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-12-13 20:06:23 UTC
Size:
2.41 KB
patch
obsolete
>From 3fc2133aad7ef5a320ea8a3304de65bd8b436b51 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 13 Dec 2018 16:59:40 -0300 >Subject: [PATCH] Bug 21460: Add tests > >--- > t/db_dependent/api/v1/illrequests.t | 16 ++++++++++++---- > 1 file changed, 12 insertions(+), 4 deletions(-) > >diff --git a/t/db_dependent/api/v1/illrequests.t b/t/db_dependent/api/v1/illrequests.t >index fb3eff9bdc..5018f0a280 100644 >--- a/t/db_dependent/api/v1/illrequests.t >+++ b/t/db_dependent/api/v1/illrequests.t >@@ -39,7 +39,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); > > subtest 'list() tests' => sub { > >- plan tests => 18; >+ plan tests => 21; > > # Mock ILLBackend (as object) > my $backend = Test::MockObject->new; >@@ -80,7 +80,8 @@ subtest 'list() tests' => sub { > $t->request_ok($tx)->status_is(200)->json_is( [] ); > > my $library = $builder->build_object( { class => 'Koha::Libraries' } ); >- my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_1 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); > > # Create an ILL request > my $illrequest = $builder->build_object( >@@ -89,7 +90,7 @@ subtest 'list() tests' => sub { > value => { > backend => 'Mock', > branchcode => $library->branchcode, >- borrowernumber => $patron->borrowernumber >+ borrowernumber => $patron_1->borrowernumber > } > } > ); >@@ -122,7 +123,7 @@ subtest 'list() tests' => sub { > value => { > backend => 'Mock', > branchcode => $library->branchcode, >- borrowernumber => $patron->borrowernumber >+ borrowernumber => $patron_2->borrowernumber > } > } > ); >@@ -146,6 +147,13 @@ subtest 'list() tests' => sub { > [{ path => '/query/request_blah', message => 'Malformed query string'}] > ); > >+ # Test the borrowernumber parameter >+ $tx = $t->ua->build_tx( GET => '/api/v1/illrequests?borrowernumber=' . $patron_2->borrowernumber ); >+ $tx->req->cookies( { name => 'CGISESSID', value => $session_id } ); >+ $tx->req->env( { REMOTE_ADDR => $remote_address } ); >+ $t->request_ok($tx)->status_is(200) >+ ->json_is( [ $response2 ] ); >+ > $schema->storage->txn_rollback; > }; > >-- >2.11.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 21460
:
82858
|
83119
|
83184
|
83185
|
83272
|
83305
|
83435
|
83674
|
88444
|
88445
|
88626
|
88679
|
88680
|
88681