From 2dc04417061ea9934578238d759ca31ca15bfa9d Mon Sep 17 00:00:00 2001 From: Lari Taskula Date: Thu, 17 Feb 2022 22:10:50 +0000 Subject: [PATCH] Bug 22000: Add unit test To test: 1. prove t/db_dependent/api/v1/illrequests.t 2. Observe test failure t/db_dependent/api/v1/illrequests.t .. # Failed test 'exact match for JSON Pointer ""' # at t/db_dependent/api/v1/illrequests.t line 163. ... --- t/db_dependent/api/v1/illrequests.t | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/t/db_dependent/api/v1/illrequests.t b/t/db_dependent/api/v1/illrequests.t index 31c220c724..e250fc5eaf 100755 --- a/t/db_dependent/api/v1/illrequests.t +++ b/t/db_dependent/api/v1/illrequests.t @@ -38,7 +38,7 @@ my $t = Test::Mojo->new('Koha::REST::V1'); subtest 'list() tests' => sub { - plan tests => 30; + plan tests => 33; # Mock ILLBackend (as object) my $backend = Test::MockObject->new; @@ -159,6 +159,11 @@ subtest 'list() tests' => sub { ->status_is(200) ->json_is( [ $response2 ] ); + # Test status parameter + $t->get_ok( "//$userid:$password@/api/v1/illrequests?status=STATUS2" ) + ->status_is(200) + ->json_is( [ $response2 ] ); + # Test the ILLHiddenRequestStatuses syspref t::lib::Mocks::mock_preference( 'ILLHiddenRequestStatuses', 'STATUS1' ); $t->get_ok( "//$userid:$password@/api/v1/illrequests" ) -- 2.25.1