From dd06b59fdcdf199471f154abbd7e2a22d192e1c4 Mon Sep 17 00:00:00 2001 From: "Joe Atzberger (siptest" Date: Wed, 4 Jun 2008 18:14:51 -0500 Subject: [PATCH] SIP tests for renew and renew_all. Signed-off-by: Joshua Ferraro --- C4/SIP/t/09renew.t | 8 ++++---- C4/SIP/t/10renew_all.t | 26 ++++++++++++-------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/C4/SIP/t/09renew.t b/C4/SIP/t/09renew.t index 61f1621f81..4868312fee 100644 --- a/C4/SIP/t/09renew.t +++ b/C4/SIP/t/09renew.t @@ -10,14 +10,14 @@ use Sip::Constants qw(:all); use SIPtest qw(:basic :user1 :item1); my $checkout_template = { - id => "Renew: prep: check out item ($item_barcode) to patron ($user_barcode)", + id => "Renew: prep: check out item ($item_barcode) to patron ($user_barcode)", msg => "11YN20060329 203000 AO$instid|AA$user_barcode|AB$item_barcode|AC|", pat => qr/^121NNY$datepat/, fields => [], }; my $checkin_template = { - id => "Renew: prep: check in item ($item_barcode)", + id => "Renew: cleanup: check in item ($item_barcode)", msg => "09N20060102 08423620060113 084235APUnder the bed|AO$instid|AB$item_barcode|AC$password|", pat => qr/^101YNN$datepat/, fields => [], @@ -39,9 +39,9 @@ my $checkin_template = { # my $renew_test_template = { - id => "Renew: item ($item_barcode) to patron ($user_barcode), renewal OK, no 3rd party, no fees", + id => "Renew: RENEW 1, item ($item_barcode) to patron ($user_barcode), renewal OK, no 3rd party, no fees", msg => "29NN20060102 084236 AO$instid|AA$user_barcode|AB$item_barcode|", - pat => qr/^301YNN$datepat/, + pat => qr/^301Y[UN][UN]$datepat/, fields => [ $SIPtest::field_specs{(FID_INST_ID)}, $SIPtest::field_specs{(FID_SCREEN_MSG)}, diff --git a/C4/SIP/t/10renew_all.t b/C4/SIP/t/10renew_all.t index afde67c6f7..66211a2d96 100644 --- a/C4/SIP/t/10renew_all.t +++ b/C4/SIP/t/10renew_all.t @@ -39,7 +39,7 @@ my @checkin_templates = ( ); my $renew_all_test_template = { - id => "Renew All: patron ($user_barcode) with 1 item checked out, no patron password", + id => "Renew All: patron ($user_barcode) with 1 item ($item_barcode) checked out, no patron password", msg => "6520060102 084236AO$instid|AA$user_barcode|", pat => qr/^66100010000$datepat/, fields => [ @@ -63,19 +63,17 @@ my @tests = ( my $test; -#$test = clone($renew_all_test_template); -#$test->{id} = 'Renew All: Valid patron, two items checked out'; -#$test->{pat} = qr/^66100020000$datepat/; -#foreach my $i (0 .. (scalar @{$test->{fields}})-1) { -# my $field = $test->{fields}[$i]; -# -# if ($field->{field} eq FID_RENEWED_ITEMS) { -# $field->{pat} = qr/^$item_barcode\|$item2_barcode$/; -# } -#} -# -#push @tests, $checkout_templates[0], $checkout_templates[1], -# $renew_all_test_template, $checkin_templates[0], $checkin_templates[1]; +$test = clone($renew_all_test_template); +$test->{id} = 'Renew All: Valid patron, two items checked out'; +$test->{pat} = qr/^66100020000$datepat/; +foreach my $i (0 .. (scalar @{$test->{fields}})-1) { + my $field = $test->{fields}[$i]; + if ($field->{field} eq FID_RENEWED_ITEMS) { + $field->{pat} = qr/^$item_barcode\|$item2_barcode$/; + } +} + +#push @tests, @checkout_templates[0..1], $renew_all_test_template, @checkin_templates[0..1]; $test = clone($renew_all_test_template); $test->{id} = 'Renew All: valid patron, invalid patron password'; -- 2.20.1