Lines 2132-2150
subtest "Test unallocated option" => sub {
Link Here
|
2132 |
"Picked the item" |
2132 |
"Picked the item" |
2133 |
); |
2133 |
); |
2134 |
|
2134 |
|
2135 |
my $timestamp = $hold->timestamp; |
2135 |
my $original_timestamp = $hold->timestamp; |
2136 |
|
2136 |
|
2137 |
sleep 2; |
2137 |
sleep 2; # Allow time to pass after first hold was placed |
2138 |
C4::HoldsQueue::CreateQueue(); |
2138 |
C4::HoldsQueue::CreateQueue(); |
2139 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2139 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2140 |
$hold = $queue_rs->next; |
2140 |
$hold = $queue_rs->next; |
2141 |
isnt( $hold->timestamp, $timestamp, "Hold was reallocated when queue fully rebuilt" ); |
2141 |
isnt( $hold->timestamp, $original_timestamp, "Hold was reallocated when queue fully rebuilt" ); |
2142 |
$timestamp = $hold->timestamp; |
2142 |
my $after_rebuild_timestamp = $hold->timestamp; |
2143 |
|
2143 |
|
|
|
2144 |
sleep 2; # Allow time to pass after first full rebuild |
2144 |
C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); |
2145 |
C4::HoldsQueue::CreateQueue( { unallocated => 1 } ); |
2145 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2146 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2146 |
$hold = $queue_rs->next; |
2147 |
$hold = $queue_rs->next; |
2147 |
is( $hold->timestamp, $timestamp, "Previously allocated hold not updated when unallocated passed" ); |
2148 |
is( $hold->timestamp, $after_rebuild_timestamp, "Previously allocated hold not updated when unallocated passed" ); |
2148 |
|
2149 |
|
2149 |
my $reserve_id_2 = AddReserve( |
2150 |
my $reserve_id_2 = AddReserve( |
2150 |
{ |
2151 |
{ |
Lines 2165-2171
subtest "Test unallocated option" => sub {
Link Here
|
2165 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2166 |
$queue_rs = $schema->resultset('TmpHoldsqueue')->search( { biblionumber => $item1->biblionumber } ); |
2166 |
$hold = $queue_rs->next; |
2167 |
$hold = $queue_rs->next; |
2167 |
is( |
2168 |
is( |
2168 |
$hold->timestamp, $timestamp, |
2169 |
$hold->timestamp, $after_rebuild_timestamp, |
2169 |
"Previously allocated hold not updated when unallocated passed and others are allocated" |
2170 |
"Previously allocated hold not updated when unallocated passed and others are allocated" |
2170 |
); |
2171 |
); |
2171 |
}; |
2172 |
}; |
2172 |
- |
|
|