Lines 67-73
subtest 'store' => sub {
Link Here
|
67 |
}; |
67 |
}; |
68 |
|
68 |
|
69 |
subtest 'holds + current_holds' => sub { |
69 |
subtest 'holds + current_holds' => sub { |
70 |
plan tests => 5; |
70 |
plan tests => 6; |
71 |
C4::Reserves::AddReserve( |
71 |
C4::Reserves::AddReserve( |
72 |
{ |
72 |
{ |
73 |
branchcode => $patron->branchcode, |
73 |
branchcode => $patron->branchcode, |
Lines 90-101
subtest 'holds + current_holds' => sub {
Link Here
|
90 |
reservation_date => dt_from_string->add( days => 2 ), |
90 |
reservation_date => dt_from_string->add( days => 2 ), |
91 |
} |
91 |
} |
92 |
); |
92 |
); |
|
|
93 |
t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 0 ); |
93 |
$holds = $biblio->holds; |
94 |
$holds = $biblio->holds; |
94 |
is( $holds->count, 1, '->holds should return future holds' ); |
95 |
is( $holds->count, 1, '->holds should return future holds' ); |
95 |
$holds = $biblio->current_holds; |
96 |
$holds = $biblio->current_holds; |
96 |
is( $holds->count, 0, '->current_holds should not return future holds' ); |
97 |
is( $holds->count, 0, '->current_holds without lookahead should not return future holds' ); |
|
|
98 |
t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 2 ); |
99 |
$holds = $biblio->current_holds; |
100 |
is( $holds->count, 1, '->current_holds with lookahead returns future holds' ); |
97 |
$holds->delete; |
101 |
$holds->delete; |
98 |
|
102 |
t::lib::Mocks::mock_preference( 'ConfirmFutureHolds', 0 ); |
99 |
}; |
103 |
}; |
100 |
|
104 |
|
101 |
subtest 'waiting_or_in_transit' => sub { |
105 |
subtest 'waiting_or_in_transit' => sub { |
102 |
- |
|
|