Bug 27797: (QA follow-up) Pickup locations can be overridden too
authorTomas Cohen Arazi <tomascohen@theke.io>
Mon, 8 Mar 2021 15:03:01 +0000 (12:03 -0300)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 4 May 2021 12:22:04 +0000 (14:22 +0200)
commite5d5fbdd3e76bf3df62a5ec4462a482ecbe0545d
tree6070ca9df81058c040aa32faec1f53d18b50bfad
parent35f7e0ca1c24f4a4d74187f86020a85301a5308e
Bug 27797: (QA follow-up) Pickup locations can be overridden too

This patch adds regression tests for overridding pickup locations, which
was inadvertedly not covered by the original dev. What this does, is
moving the $can_override variable definition above, and avoid returning
400 if conditions are not met for the passed pickup_library_id, when
$can_override is true.

To test:
1. Apply this patch
2. Run:
   $ kshell
  k$ prove t/db_dependent/api/v1/holds.t
=> SUCCESS: Tests pass!

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Koha/REST/V1/Holds.pm
t/db_dependent/api/v1/holds.t