From cb1db1ddb11cadc9dc39ec9440fb1b27a66d6835 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 3 Dec 2019 19:54:07 +0000 Subject: [PATCH] Bug 24164: Unit test Signed-off-by: Jonathan Druart Signed-off-by: Martin Renvoize Signed-off-by: Joy Nelson --- t/db_dependent/Reports/Guided.t | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t index 5a8b6fa007..4488d4c5d4 100644 --- a/t/db_dependent/Reports/Guided.t +++ b/t/db_dependent/Reports/Guided.t @@ -361,11 +361,12 @@ count(h.reservedate) AS 'holds' subtest 'Email report test' => sub { - plan tests => 8; + plan tests => 9; my $id1 = $builder->build({ source => 'Borrower',value => { surname => 'mailer', email => 'a@b.com' } })->{ borrowernumber }; my $id2 = $builder->build({ source => 'Borrower',value => { surname => 'nomailer', email => undef } })->{ borrowernumber }; - my $report1 = $builder->build({ source => 'SavedSql', value => { savedsql => "SELECT surname,borrowernumber,email FROM borrowers WHERE borrowernumber IN ($id1,$id2)" } })->{ id }; + my $id3 = $builder->build({ source => 'Borrower',value => { surname => 'norman', email => 'a@b.com' } })->{ borrowernumber }; + my $report1 = $builder->build({ source => 'SavedSql', value => { savedsql => "SELECT surname,borrowernumber,email FROM borrowers WHERE borrowernumber IN ($id1,$id2,$id3)" } })->{ id }; my $report2 = $builder->build({ source => 'SavedSql', value => { savedsql => "SELECT potato FROM mashed" } })->{ id }; my $letter1 = $builder->build({ @@ -408,6 +409,7 @@ subtest 'Email report test' => sub { ($emails, $errors ) = C4::Reports::Guided::EmailReport({report_id => $report1, module => $letter1->{module} , code => $letter1->{code}, from => 'the@future.ooh' }); is( $emails->[0]{letter}->{content}, "mailer", "Message has expected content"); + is( $emails->[1]{letter}->{content}, "norman", "Message has expected content"); }; -- 2.39.5