Bugzilla – Attachment 106206 Details for
Bug 25662
Create hold route does not check maxreserves syspref
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 25662: (follow-up) Add tests for the wrong patron_id added behaviour
Bug-25662-follow-up-Add-tests-for-the-wrong-patron.patch (text/plain), 1.93 KB, created by
Tomás Cohen Arazi (tcohen)
on 2020-06-23 13:39:25 UTC
(
hide
)
Description:
Bug 25662: (follow-up) Add tests for the wrong patron_id added behaviour
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2020-06-23 13:39:25 UTC
Size:
1.93 KB
patch
obsolete
>From 9cbaf38aff10f5be51925290f942287e5e24cf5e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 23 Jun 2020 10:35:54 -0300 >Subject: [PATCH] Bug 25662: (follow-up) Add tests for the wrong patron_id > added behaviour > >This patch adds trivial tests for the new error (400) raised when the >passed patron_id doesn't exist. > >To test: >1. Run: > $ kshell > k$ prove t/db_dependent/api/v1/holds.t >=> SUCCESS: Tests pass! >2. Sign off :-D > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > t/db_dependent/api/v1/holds.t | 16 +++++++++++++++- > 1 file changed, 15 insertions(+), 1 deletion(-) > >diff --git a/t/db_dependent/api/v1/holds.t b/t/db_dependent/api/v1/holds.t >index 348cb6bc263..750bcd95b44 100644 >--- a/t/db_dependent/api/v1/holds.t >+++ b/t/db_dependent/api/v1/holds.t >@@ -199,7 +199,7 @@ subtest "Test endpoints without permission" => sub { > > subtest "Test endpoints with permission" => sub { > >- plan tests => 59; >+ plan tests => 62; > > $t->get_ok( "//$userid_1:$password@/api/v1/holds" ) > ->status_is(200) >@@ -286,6 +286,20 @@ subtest "Test endpoints with permission" => sub { > $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) > ->status_is(403) > ->json_like('/error', qr/itemAlreadyOnHold/); >+ >+ my $to_delete_patron = $builder->build_object({ class => 'Koha::Patrons' }); >+ my $deleted_patron_id = $to_delete_patron->borrowernumber; >+ $to_delete_patron->delete; >+ >+ my $tmp_patron_id = $post_data->{patron_id}; >+ $post_data->{patron_id} = $deleted_patron_id; >+ $t->post_ok( "//$userid_3:$password@/api/v1/holds" => json => $post_data ) >+ ->status_is(400) >+ ->json_is( { error => 'patron_id not found' } ); >+ >+ # Restore the original patron_id as it is expected by the next subtest >+ # FIXME: this tests need to be rewritten from scratch >+ $post_data->{patron_id} = $tmp_patron_id; > }; > > subtest 'Reserves with itemtype' => sub { >-- >2.27.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 25662
:
106204
|
106205
|
106206
|
106212
|
106213
|
106214
|
106297
|
106298
|
106299
|
108940
|
108941
|
108942