Bugzilla – Attachment 163034 Details for
Bug 35967
Add /api/v1/patrons/{patron_id}/recalls endpoint to list a patron's recalls
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35967: Add more test cases
Bug-35967-Add-more-test-cases.patch (text/plain), 2.07 KB, created by
Tomás Cohen Arazi (tcohen)
on 2024-03-11 13:47:04 UTC
(
hide
)
Description:
Bug 35967: Add more test cases
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2024-03-11 13:47:04 UTC
Size:
2.07 KB
patch
obsolete
>From c4913eb518ce779e28bb9ea388bacd2eba8b8eba Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 11 Mar 2024 10:45:08 -0300 >Subject: [PATCH] Bug 35967: Add more test cases > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/patrons_recalls.t | 14 +++++++++++++- > 1 file changed, 13 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/patrons_recalls.t b/t/db_dependent/api/v1/patrons_recalls.t >index 2b7dc046e91..5943af95282 100755 >--- a/t/db_dependent/api/v1/patrons_recalls.t >+++ b/t/db_dependent/api/v1/patrons_recalls.t >@@ -34,7 +34,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 ); > > subtest 'list() tests' => sub { > >- plan tests => 9; >+ plan tests => 15; > > $schema->storage->txn_begin; > >@@ -54,10 +54,22 @@ subtest 'list() tests' => sub { > my $recall_1 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } ); > my $recall_2 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron->id } } ); > >+ # Add another patron >+ my $patron_2 = $builder->build_object( { class => 'Koha::Patrons' } ); >+ my $recall_3 = $builder->build_object( { class => 'Koha::Recalls', value => { patron_id => $patron_2->id } } ); >+ > $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron->id . '/recalls?_order_by=+me.recall_id' ) > ->status_is( 200, 'SWAGGER3.2.2' ) > ->json_is( '' => [ $recall_1->to_api, $recall_2->to_api ], 'Recalls retrieved' ); > >+ $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron_2->id . '/recalls?_order_by=+me.recall_id' ) >+ ->status_is( 200, 'SWAGGER3.2.2' )->json_is( '' => [ $recall_3->to_api ], 'Recalls retrieved' ); >+ >+ $recall_3->delete; >+ >+ $t->get_ok( "//$userid:$password@/api/v1/patrons/" . $patron_2->id . '/recalls?_order_by=+me.recall_id' ) >+ ->status_is( 200, 'SWAGGER3.2.2' )->json_is( [] ); >+ > my $non_existent_patron = $builder->build_object( { class => 'Koha::Patrons' } ); > my $non_existent_patron_id = $non_existent_patron->id; > >-- >2.44.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 35967
:
161708
|
161924
|
163032
|
163033
| 163034