From ca796499176246562e27ff5476c612eabb12bff6 Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Mon, 8 Jun 2020 11:17:46 +0000 Subject: [PATCH] Bug 25037: (follow-up) Fix checkout_type property description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also adds a test of the property to checkouts.t REST test. To test: 1. prove t/db_dependent/api/v1/checkouts.t Signed-off-by: Joonas Kylmälä --- api/v1/swagger/definitions/checkout.json | 6 +++++- t/db_dependent/api/v1/checkouts.t | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/api/v1/swagger/definitions/checkout.json b/api/v1/swagger/definitions/checkout.json index c925c452ac..d2a7fe696a 100644 --- a/api/v1/swagger/definitions/checkout.json +++ b/api/v1/swagger/definitions/checkout.json @@ -54,7 +54,11 @@ }, "checkout_type": { "type": ["string", "null"], - "description": "Checkout type, an authorised value under CHECKOUT_TYPE category" + "enum": [ + "CHECKOUT", + "ONSITE" + ], + "description": "Checkout type" }, "note": { "type": ["string", "null"], diff --git a/t/db_dependent/api/v1/checkouts.t b/t/db_dependent/api/v1/checkouts.t index 5f7f4ed2fe..f6c06ecad8 100644 --- a/t/db_dependent/api/v1/checkouts.t +++ b/t/db_dependent/api/v1/checkouts.t @@ -17,7 +17,7 @@ use Modern::Perl; -use Test::More tests => 93; +use Test::More tests => 94; use Test::MockModule; use Test::Mojo; use t::lib::Mocks; @@ -170,6 +170,7 @@ $t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id) ->json_is('/patron_id' => $patron_id) ->json_is('/item_id' => $item1->itemnumber) ->json_is('/due_date' => output_pref({ dateformat => "rfc3339", dt => $date_due1 }) ) + ->json_is('/checkout_type' => $issue1->checkout_type) ->json_hasnt('/1'); $t->get_ok( "//$userid:$password@/api/v1/checkouts/" . $issue1->issue_id) -- 2.11.0