From: Mike Taylor Date: Wed, 12 Dec 2012 15:15:57 +0000 (+0000) Subject: Check that record returned in piggyback after OPAC-record request X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=commitdiff_plain;h=b938351478bc4e6a24c5ffee7257be0fba5424fa Check that record returned in piggyback after OPAC-record request really is an OPAC record. Fixes bug IR-331. --- 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);