Bug 42443: (QA follow-up) Test from_library_id query filter
The OpenAPI spec documents from_library_id as a supported filter parameter but the test suite only exercised to_library_id. Add a test to verify filtering by source library returns the correct transfer. Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk> Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
This commit is contained in:
parent
02a02c7209
commit
e5a07ccd25
|
|
@ -36,7 +36,7 @@ t::lib::Mocks::mock_preference( 'RESTBasicAuth', 1 );
|
|||
|
||||
subtest 'list() tests' => sub {
|
||||
|
||||
plan tests => 19;
|
||||
plan tests => 22;
|
||||
|
||||
$schema->storage->txn_begin;
|
||||
|
||||
|
|
@ -100,6 +100,11 @@ subtest 'list() tests' => sub {
|
|||
->status_is(200)
|
||||
->json_is( '' => [ $transfer_0->to_api ], 'filtering by to_library_id returns the matching transfer' );
|
||||
|
||||
# Filtering by source library
|
||||
$t->get_ok( "//$userid:$password@/api/v1/transfers?from_library_id=" . $transfer_1->frombranch )
|
||||
->status_is(200)
|
||||
->json_is( '' => [ $transfer_1->to_api ], 'filtering by from_library_id returns the matching transfer' );
|
||||
|
||||
# Embeds resolve through the item
|
||||
$t->get_ok( "//$userid:$password@/api/v1/transfers?to_library_id="
|
||||
. $library_a->branchcode => { 'x-koha-embed' => 'item.biblio,from_library' } )
|
||||
|
|
@ -179,9 +184,8 @@ subtest 'delete() tests' => sub {
|
|||
}
|
||||
}
|
||||
);
|
||||
$t->delete_ok(
|
||||
"//$userid:$password@/api/v1/transfers/" . $arrived_transfer->id => json =>
|
||||
{ cancellation_reason => 'Manual' } )->status_is(400);
|
||||
$t->delete_ok( "//$userid:$password@/api/v1/transfers/"
|
||||
. $arrived_transfer->id => json => { cancellation_reason => 'Manual' } )->status_is(400);
|
||||
|
||||
# Cancel an in-transit transfer with the supplied reason
|
||||
$t->delete_ok(
|
||||
|
|
|
|||
Loading…
Reference in New Issue