From d223cc6364f1f94c09a99e1e195a6cdce6c84df0 Mon Sep 17 00:00:00 2001 From: djfiander Date: Wed, 14 Jun 2006 02:15:05 +0000 Subject: [PATCH] Test that when a second hold is placed on an item, the queue position is properly reported. --- t/07hold.t | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/t/07hold.t b/t/07hold.t index 64aebb4..8f8d2fa 100644 --- a/t/07hold.t +++ b/t/07hold.t @@ -24,7 +24,7 @@ my $hold_test_template = { pat => $datepat, required => 0, }, { field => FID_QUEUE_POS, - pat => qr/^[0-9]$/, + pat => qr/^1$/, required => 1, }, { field => FID_PICKUP_LOCN, pat => qr/^Taylor$/, @@ -41,14 +41,17 @@ my $hold_count_test_template0 = { id => 'Confirm patron has 0 holds', msg => '6300020060329 201700 AOUWOLS|AAdjfiander|', pat => qr/^64 [ Y]{13}\d{3}${datepat}0000(\d{4}){5}/, + fields => [], }; my $hold_count_test_template1 = { id => 'Confirm patron has 1 hold', msg => '6300020060329 201700 AOUWOLS|AAdjfiander|', pat => qr/^64 [ Y]{13}\d{3}${datepat}0001(\d{4}){5}/, + fields => [], }; + my @tests = ( $SIPtest::login_test, $SIPtest::sc_status_test, @@ -57,6 +60,23 @@ my @tests = ( my $test; +# Hold Queue: second hold placed on item +$test = clone($hold_test_template); +$test->{id} = 'Place hold: second hold on item'; +$test->{msg} =~ s/djfiander/miker/; +$test->{pat} = qr/^161N$datepat/; +foreach my $i (0 .. (scalar @{$test->{fields}})-1) { + my $field = $test->{fields}[$i]; + + if ($field->{field} eq FID_PATRON_ID) { + $field->{pat} = qr/^miker$/; + } elsif ($field->{field} eq FID_QUEUE_POS) { + $field->{pat} = qr/^2$/; + } +} + +push @tests, $test; + # Cancel hold: valid hold $test = clone($hold_test_template); $test->{id} = 'Cancel hold: valid hold'; -- 2.11.0