diff options
Diffstat (limited to 't/app/helpers')
-rw-r--r-- | t/app/helpers/send_email.t | 10 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample.txt | 2 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample_mime.txt | 2 |
3 files changed, 11 insertions, 3 deletions
diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t index 58b9acaaa..522ee39d0 100644 --- a/t/app/helpers/send_email.t +++ b/t/app/helpers/send_email.t @@ -17,7 +17,7 @@ my $mech = FixMyStreet::TestMech->new; my $c = ctx_request("/"); # set some values in the stash -$c->stash->{foo} = 'bar'; +$c->stash->{foo} = 'bar <b>bold</b>'; # clear the email queue $mech->clear_emails_ok; @@ -118,6 +118,14 @@ subtest 'Inline emails!' => sub { \ {10}\+\ text/plain.*\n \ {10}\+\ text/html.*\n \ {5}\+\ image/gif]x; + $email->walk_parts(sub { + my ($part) = @_; + if ($part->content_type =~ m[text/plain]i) { + like $part->body_str, qr/foo: bar <b>bold<\/b>/; + } elsif ($part->content_type =~ m[text/html]i) { + like $part->body_str, qr/foo: bar <b>bold<\/b>/; + } + }); $mech->clear_emails_ok; }; diff --git a/t/app/helpers/send_email_sample.txt b/t/app/helpers/send_email_sample.txt index 68fe61f0e..e14c536be 100644 --- a/t/app/helpers/send_email_sample.txt +++ b/t/app/helpers/send_email_sample.txt @@ -7,7 +7,7 @@ From: CONTACT_EMAIL Hello, -This is a test email where foo: bar. +This is a test email where foo: bar <b>bold</b>. utf8: =E6=88=91=E4=BB=AC=E5=BA=94=E8=AF=A5=E8=83=BD=E5=A4=9F=E6=97=A0=E7=BC= =9D=E5=A4=84=E7=90=86UTF8=E7=BC=96=E7=A0=81 diff --git a/t/app/helpers/send_email_sample_mime.txt b/t/app/helpers/send_email_sample_mime.txt index 7b4ce91f6..623874149 100644 --- a/t/app/helpers/send_email_sample_mime.txt +++ b/t/app/helpers/send_email_sample_mime.txt @@ -12,7 +12,7 @@ Content-Transfer-Encoding: quoted-printable Hello,
-This is a test email where foo: bar.
+This is a test email where foo: bar <b>bold</b>.
utf8: =E6=88=91=E4=BB=AC=E5=BA=94=E8=AF=A5=E8=83=BD=E5=A4=9F=E6=97=A0=E7=BC=
=9D=E5=A4=84=E7=90=86UTF8=E7=BC=96=E7=A0=81
|