Bugzilla – Attachment 124891 Details for
Bug 27884
Add HTML mail support for patron emailer script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27884: Add tests
Bug-27884-Add-tests.patch (text/plain), 3.02 KB, created by
David Gustafsson
on 2021-09-15 13:33:12 UTC
(
hide
)
Description:
Bug 27884: Add tests
Filename:
MIME Type:
Creator:
David Gustafsson
Created:
2021-09-15 13:33:12 UTC
Size:
3.02 KB
patch
obsolete
>From b5cdbd7d5c68c69ea95896279a0d12d3084fb2bf Mon Sep 17 00:00:00 2001 >From: David Gustafsson <glasklas@gmail.com> >Date: Wed, 15 Sep 2021 15:32:35 +0200 >Subject: [PATCH] Bug 27884: Add tests > >--- > t/db_dependent/Reports/Guided.t | 22 +++++++++++++++++++--- > 1 file changed, 19 insertions(+), 3 deletions(-) > >diff --git a/t/db_dependent/Reports/Guided.t b/t/db_dependent/Reports/Guided.t >index 6373c0e647..705bd7f68a 100755 >--- a/t/db_dependent/Reports/Guided.t >+++ b/t/db_dependent/Reports/Guided.t >@@ -365,7 +365,7 @@ count(h.reservedate) AS 'holds' > > subtest 'Email report test' => sub { > >- plan tests => 12; >+ plan tests => 14; > my $dbh = C4::Context->dbh; > > my $id1 = $builder->build({ source => 'Borrower',value => { surname => 'mailer', email => 'a@b.com', emailpro => 'b@c.com' } })->{ borrowernumber }; >@@ -379,7 +379,8 @@ subtest 'Email report test' => sub { > value => { > content => "[% surname %]", > branchcode => "", >- message_transport_type => 'email' >+ message_transport_type => 'email', >+ is_html => undef > } > }); > my $letter2 = $builder->build({ >@@ -387,7 +388,18 @@ subtest 'Email report test' => sub { > value => { > content => "[% firstname %]", > branchcode => "", >- message_transport_type => 'email' >+ message_transport_type => 'email', >+ is_html => 0 >+ } >+ }); >+ >+ my $letter3 = $builder->build({ >+ source => 'Letter', >+ value => { >+ content => "[% surname %]", >+ branchcode => "", >+ message_transport_type => 'email', >+ is_html => 1 > } > }); > >@@ -416,12 +428,16 @@ 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"); >+ is( $emails->[0]{letter}->{'content-type'}, undef, "Message content type is not set for plain text mail"); > > ($emails, $errors ) = C4::Reports::Guided::EmailReport({report_id => $report1, module => $letter1->{module} , code => $letter1->{code}, from => 'the@future.ooh', email => 'emailpro' }); > is_deeply( $errors, [{'NO_EMAIL_COL'=>3}],"We report missing email in emailpro column"); > is( $emails->[0]->{to_address}, 'b@c.com', "Message uses correct email"); > is( $emails->[1]->{to_address}, 'd@e.com', "Message uses correct email"); > >+ ($emails) = C4::Reports::Guided::EmailReport({report_id => $report1, module => $letter3->{module} , code => $letter3->{code}, from => 'the@future.ooh' }); >+ is( $emails->[0]{letter}->{'content-type'}, 'text/html; charset="UTF-8"', "Message has expected content type"); >+ > }; > > $schema->storage->txn_rollback; >-- >2.20.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 27884
:
117869
|
117942
|
117943
|
118929
|
124890
|
124891
|
125755
|
125756
|
127184
|
127185