From 4ab0a277531de944841a7e7b9f15dc78acffdd17 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Wed, 24 Apr 2024 11:25:19 +0000 Subject: [PATCH] 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 --- api/v1/swagger/definitions/patron_category.yaml | 4 ++-- t/db_dependent/api/v1/patron_categories.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/api/v1/swagger/definitions/patron_category.yaml b/api/v1/swagger/definitions/patron_category.yaml index 204ba9726a..ec3c87aa9c 100644 --- a/api/v1/swagger/definitions/patron_category.yaml +++ b/api/v1/swagger/definitions/patron_category.yaml @@ -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: diff --git a/t/db_dependent/api/v1/patron_categories.t b/t/db_dependent/api/v1/patron_categories.t index 16504569f8..ecad6041e7 100755 --- a/t/db_dependent/api/v1/patron_categories.t +++ b/t/db_dependent/api/v1/patron_categories.t @@ -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; -- 2.39.5