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
description: Type of Koha patron (Adult, Child, Professional, Organizational, Statistical, Staff)
block_expired_patron_opac_actions:
type: number
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
type: string
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:
type: string
enum:

View file

@ -98,7 +98,7 @@ subtest 'list() tests' => sub {
$off_limits_librarian->branchcode( $library->branchcode )->store;
$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;