From b6c3c19a6de4b1a93e6e410acea76ace9b73a666 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 13 May 2020 09:57:40 +0200 Subject: [PATCH] Bug 24161: Fix failing test (when running slow) We "mocked" the claim date to make sure we were not going to hit this problem, but it's not done on the correct claim, it should be done on the last one (so second). from Koha::Acq::Order->claimed_date 294 my $last_claim = $self->claims->last; 295 return unless $last_claim; 296 return $last_claim->claimed_on; --- t/db_dependent/Koha/Acquisition/Order.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/db_dependent/Koha/Acquisition/Order.t b/t/db_dependent/Koha/Acquisition/Order.t index 8f1fd88311..7d1add94a4 100644 --- a/t/db_dependent/Koha/Acquisition/Order.t +++ b/t/db_dependent/Koha/Acquisition/Order.t @@ -373,7 +373,7 @@ subtest 'claim*' => sub { my $claim_1 = $order->claim; my $claim_2 = $order->claim; - $claim_1->claimed_on($now->clone->subtract(days => 1))->store; + $claim_2->claimed_on($now->clone->subtract(days => 1))->store; is( $order->claims->count, 2, '->claims should return the correct number of claims'); is( $order->claims_count, 2, '->claims_count should return the correct number of claims'); -- 2.20.1