From b938351478bc4e6a24c5ffee7257be0fba5424fa Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Wed, 12 Dec 2012 15:15:57 +0000 Subject: [PATCH] Check that record returned in piggyback after OPAC-record request really is an OPAC record. Fixes bug IR-331. --- lib/ZOOM/IRSpy/Test/Record/OPAC.pm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm index 4045201..caca4ce 100644 --- a/lib/ZOOM/IRSpy/Test/Record/OPAC.pm +++ b/lib/ZOOM/IRSpy/Test/Record/OPAC.pm @@ -75,8 +75,16 @@ sub completed_search { # We have a result-set of three of more records, and we requested # that those records be included in the Search Response using # piggybacking. Was it done? + my $ok = 0; my $rec = $task->{rs}->record_immediate(2); - my $ok = defined $rec && $rec->error() == 0; + if (defined $rec) { + my $syntax = $rec->get("syntax"); + if (lc($syntax) ne "opac") { + $conn->log("irspy_test", "requested OPAC record, but got $syntax"); + } else { + $ok = $rec->error() == 0; + } + } $task->{rs}->destroy(); $conn->record()->store_result('multiple_opac', 'ok' => $ok); -- 1.7.10.4