Lines 572-578
subtest 'Holds test with start_date and end_date' => sub {
Link Here
|
572 |
|
572 |
|
573 |
subtest 'GetRecords' => sub { |
573 |
subtest 'GetRecords' => sub { |
574 |
|
574 |
|
575 |
plan tests => 1; |
575 |
plan tests => 8; |
576 |
|
576 |
|
577 |
$schema->storage->txn_begin; |
577 |
$schema->storage->txn_begin; |
578 |
|
578 |
|
Lines 591-596
subtest 'GetRecords' => sub {
Link Here
|
591 |
} |
591 |
} |
592 |
); |
592 |
); |
593 |
|
593 |
|
|
|
594 |
my $patron = $builder->build({ |
595 |
source => 'Borrower', |
596 |
}); |
597 |
|
598 |
my $issue = $builder->build({ |
599 |
source => 'Issue', |
600 |
value => { |
601 |
itemnumber => $item->itemnumber, |
602 |
} |
603 |
}); |
604 |
|
605 |
my $hold = $builder->build({ |
606 |
source => 'Reserve', |
607 |
value => { |
608 |
biblionumber => $item->biblionumber, |
609 |
} |
610 |
}); |
611 |
|
594 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
612 |
ModItemTransfer($item->itemnumber, $branch1->{branchcode}, $branch2->{branchcode}); |
595 |
|
613 |
|
596 |
my $cgi = CGI->new; |
614 |
my $cgi = CGI->new; |
Lines 608-613
subtest 'GetRecords' => sub {
Link Here
|
608 |
is_deeply($reply->{record}->[0]->{items}->{item}->[0]->{transfer}, $expected, |
626 |
is_deeply($reply->{record}->[0]->{items}->{item}->[0]->{transfer}, $expected, |
609 |
'GetRecords returns transfer informations'); |
627 |
'GetRecords returns transfer informations'); |
610 |
|
628 |
|
|
|
629 |
# Check informations exposed |
630 |
my $reply_issue = $reply->{record}->[0]->{issues}->{issue}->[0]; |
631 |
is($reply_issue->{itemnumber}, $item->itemnumber, 'GetRecords has an issue tag'); |
632 |
is($reply_issue->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in issue tag'); |
633 |
is($reply_issue->{surname}, undef, 'GetRecords does not expose surname in issue tag'); |
634 |
is($reply_issue->{firstname}, undef, 'GetRecords does not expose firstname in issue tag'); |
635 |
is($reply_issue->{cardnumber}, undef, 'GetRecords does not expose cardnumber in issue tag'); |
636 |
my $reply_reserve = $reply->{record}->[0]->{reserves}->{reserve}->[0]; |
637 |
is($reply_reserve->{biblionumber}, $item->biblionumber, 'GetRecords has a reserve tag'); |
638 |
is($reply_reserve->{borrowernumber}, undef, 'GetRecords does not expose borrowernumber in reserve tag'); |
639 |
|
611 |
$schema->storage->txn_rollback; |
640 |
$schema->storage->txn_rollback; |
612 |
}; |
641 |
}; |
613 |
|
642 |
|
614 |
- |
|
|