Browse Source

Bug 15524: (QA follow-up) Fix meaningless test

The last test claims to allow a hold when branch=5 and patron=5, but look
at the preceding statements:
    $rule_branch->max_holds(5);
    $rule_branch->update();
    $rule_branch->max_holds(5);
    $rule_branch->insert();
The last insert will not be done, since the record is already present.
A create should have triggered an error on the primary key.
Obviously, we should use $rule_all.

Test plan:
Run the test again.

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
18.11.x
Marcel de Rooy 5 years ago
committed by Nick Clemens
parent
commit
038e86a395
  1. 4
      t/db_dependent/Holds.t

4
t/db_dependent/Holds.t

@ -472,8 +472,8 @@ subtest 'Test max_holds per library/patron category' => sub {
$rule_branch->max_holds(5);
$rule_branch->update();
$rule_branch->max_holds(5);
$rule_branch->insert();
$rule_all->max_holds(5);
$rule_all->insert();
$ret = CanItemBeReserved( $borrowernumbers[0], $itemnumber );
is( $ret, 'OK', 'Patron can place hold with branch/category rule of 5, category rule of 5' );

Loading…
Cancel
Save