Bug 36453: (QA follow-up) Update api spec

Access {staff_url}/api/v1/patron_categories and notice all is as expected
Update some patron category's blocked expired patron OPAC actions and access the endpoint again, notice it's okay.

Updated API tests to include to_api confirming attributes are rendered correctly:
prove t/db_dependent/api/v1/patron_categories

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Pedro Amorim 2024-04-24 11:25:19 +00:00 committed by Martin Renvoize
parent 9845fb2f42
commit 4ab0a27753
Signed by: martin.renvoize
GPG key ID: 422B469130441A0F
2 changed files with 3 additions and 3 deletions

View file

@ -57,8 +57,8 @@ properties:
type: string type: string
description: Type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff) description: Type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
block_expired_patron_opac_actions: block_expired_patron_opac_actions:
type: number type: string
description: Whether or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions description: Specific actions expired patrons of this category are blocked from performing. OPAC actions blocked based on the patron category take priority over this preference
default_privacy: default_privacy:
type: string type: string
enum: enum:

View file

@ -98,7 +98,7 @@ subtest 'list() tests' => sub {
$off_limits_librarian->branchcode( $library->branchcode )->store; $off_limits_librarian->branchcode( $library->branchcode )->store;
$t->get_ok("//$off_limits_userid:$off_limits_password@/api/v1/patron_categories?q={\"me.categorycode\":\"TEST\"}") $t->get_ok("//$off_limits_userid:$off_limits_password@/api/v1/patron_categories?q={\"me.categorycode\":\"TEST\"}")
->status_is(200)->json_has('/0/name')->json_is( '/0/name' => 'Test' )->json_hasnt('/1'); ->status_is(200)->json_has('/0/name')->json_is( [ $category->to_api ] )->json_hasnt('/1');
$schema->storage->txn_rollback; $schema->storage->txn_rollback;