|
Lines 2252-2270
subtest "Test unallocated option" => sub {
Link Here
|
| 2252 |
"Picked the item" |
2252 |
"Picked the item" |
| 2253 |
); |
2253 |
); |
| 2254 |
|
2254 |
|
| 2255 |
my $timestamp = $hold->timestamp; |
2255 |
my $original_timestamp = $hold->timestamp; |
| 2256 |
|
2256 |
|
| 2257 |
sleep 2; |
2257 |
sleep 2; # Allow time to pass after first hold was placed |
| 2258 |
C4::HoldsQueue::CreateQueue(); |
2258 |
C4::HoldsQueue::CreateQueue(); |
| 2259 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2259 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
| 2260 |
$hold = $queue_rs->next; |
2260 |
$hold = $queue_rs->next; |
| 2261 |
isnt( $hold->timestamp, $timestamp, "Hold was reallocated when queue fully rebuilt" ); |
2261 |
isnt( $hold->timestamp, $original_timestamp, "Hold was reallocated when queue fully rebuilt" ); |
| 2262 |
$timestamp = $hold->timestamp; |
2262 |
my $after_rebuild_timestamp = $hold->timestamp; |
| 2263 |
|
2263 |
|
|
|
2264 |
sleep 2; # Allow time to pass after first full rebuild |
| 2264 |
C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); |
2265 |
C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); |
| 2265 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2266 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
| 2266 |
$hold = $queue_rs->next; |
2267 |
$hold = $queue_rs->next; |
| 2267 |
is( $hold->timestamp, $timestamp, "Previously allocated hold not updated when unallocated passed" ); |
2268 |
is( $hold->timestamp, $after_rebuild_timestamp, "Previously allocated hold not updated when unallocated passed" ); |
| 2268 |
|
2269 |
|
| 2269 |
my $reserve_id_2 = AddReserve( |
2270 |
my $reserve_id_2 = AddReserve( |
| 2270 |
{ |
2271 |
{ |
|
Lines 2285-2291
subtest "Test unallocated option" => sub {
Link Here
|
| 2285 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2286 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
| 2286 |
$hold = $queue_rs->next; |
2287 |
$hold = $queue_rs->next; |
| 2287 |
is( |
2288 |
is( |
| 2288 |
$hold->timestamp, $timestamp, |
2289 |
$hold->timestamp, $after_rebuild_timestamp, |
| 2289 |
"Previously allocated hold not updated when unallocated passed and others are allocated" |
2290 |
"Previously allocated hold not updated when unallocated passed and others are allocated" |
| 2290 |
); |
2291 |
); |
| 2291 |
}; |
2292 |
}; |
| 2292 |
- |
|
|