diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-03-31 14:17:54 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2016-03-31 14:17:54 +0100 |
commit | dac0d4c71018c01d858d0111d0f772b49a6e124d (patch) | |
tree | 191bb55f2ebb738d8fccb8b3e73db5688aff291a /t/app/helpers | |
parent | 6702f44f92e9c74fe6d2dd1c69c5418a15af178c (diff) | |
parent | e4707406bd816fb9b1bb2077b7452cc77dec3d94 (diff) |
Merge remote-tracking branch 'mysociety/refactor-email'
Diffstat (limited to 't/app/helpers')
-rw-r--r-- | t/app/helpers/send_email.t | 3 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample.txt | 4 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample_mime.txt | 106 |
3 files changed, 51 insertions, 62 deletions
diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t index f60f7fa5a..e2c8688a8 100644 --- a/t/app/helpers/send_email.t +++ b/t/app/helpers/send_email.t @@ -41,8 +41,7 @@ my $email = Email::MIME->new($email_as_string); my $expected_email_content = path(__FILE__)->parent->child('send_email_sample.txt')->slurp; my $name = FixMyStreet->config('CONTACT_NAME'); -$name = "\"$name\"" if $name =~ / /; -my $sender = $name . ' <' . FixMyStreet->config('DO_NOT_REPLY_EMAIL') . '>'; +my $sender = '"' . $name . '" <' . FixMyStreet->config('DO_NOT_REPLY_EMAIL') . '>'; $expected_email_content =~ s{CONTACT_EMAIL}{$sender}; my $expected_email = Email::MIME->new($expected_email_content); diff --git a/t/app/helpers/send_email_sample.txt b/t/app/helpers/send_email_sample.txt index 1ccce6a23..0f7406172 100644 --- a/t/app/helpers/send_email_sample.txt +++ b/t/app/helpers/send_email_sample.txt @@ -1,5 +1,5 @@ MIME-Version: 1.0 -Subject: test email =?utf-8?Q?=E2=98=BA?= +Subject: =?UTF-8?B?dGVzdCBlbWFpbCDimLo=?= Content-Type: text/plain; charset="utf-8" To: test@recipient.com Content-Transfer-Encoding: quoted-printable @@ -24,5 +24,3 @@ culpa qui officia deserunt mollit anim id est laborum. Yours,=20=20 FixMyStreet.=20= - - diff --git a/t/app/helpers/send_email_sample_mime.txt b/t/app/helpers/send_email_sample_mime.txt index c4ca97bcc..0649d1ceb 100644 --- a/t/app/helpers/send_email_sample_mime.txt +++ b/t/app/helpers/send_email_sample_mime.txt @@ -1,57 +1,49 @@ -MIME-Version: 1.0 -Subject: test email =?utf-8?Q?=E2=98=BA?= -Content-Type: multipart/mixed; boundary="BOUNDARY" -To: test@recipient.com -Content-Transfer-Encoding: 7bit -From: CONTACT_EMAIL - - ---BOUNDARY -MIME-Version: 1.0 -Subject: test email =?utf-8?Q?=E2=98=BA?= -Content-Type: text/plain; charset="utf-8" -To: test@recipient.com -Content-Transfer-Encoding: quoted-printable -From: CONTACT_EMAIL - -Hello, - -This is a test email where foo: bar. - -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 - - indented_text - -long line: Lorem ipsum dolor sit amet, consectetur adipisicing elit, -sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. -Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris -nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in -reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla -pariatur. Excepteur sint occaecat cupidatat non proident, sunt in -culpa qui officia deserunt mollit anim id est laborum. - -Yours,=20=20 -FixMyStreet.=20= - - - ---BOUNDARY -MIME-Version: 1.0 -Content-Type: image/gif; name="foo.gif" -Content-Disposition: inline; filename="foo.gif" -Content-Transfer-Encoding: quoted-printable - -GIF89a=01=00=01=00=80=00=00=00=00=00=CC=CC=CC,=00=00=00=00=01=00=01=00=00= -=02=01L=00;= - ---BOUNDARY -MIME-Version: 1.0 -Content-Type: image/gif; name="bar.gif" -Content-Disposition: inline; filename="bar.gif" -Content-Transfer-Encoding: quoted-printable - -GIF89a=01=00=01=00=80=00=00=00=00=00=CC=CC=CC,=00=00=00=00=01=00=01=00=00= -=02=01L=00;= - ---BOUNDARY-- +MIME-Version: 1.0
+Subject: =?UTF-8?B?dGVzdCBlbWFpbCDimLo=?=
+Content-Type: multipart/mixed; boundary="BOUNDARY"
+To: test@recipient.com
+Content-Transfer-Encoding: 7bit
+From: CONTACT_EMAIL
+
+
+--BOUNDARY
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: quoted-printable
+
+Hello,
+
+This is a test email where foo: bar.
+
+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
+
+ indented_text
+
+long line: Lorem ipsum dolor sit amet, consectetur adipisicing elit,
+sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
+Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
+nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
+reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+culpa qui officia deserunt mollit anim id est laborum.
+
+Yours,=20=20
+FixMyStreet.=20=
+
+--BOUNDARY
+Content-Type: image/gif; name="foo.gif"
+Content-Disposition: inline; filename="foo.gif"
+Content-Transfer-Encoding: quoted-printable
+
+GIF89a=01=00=01=00=80=00=00=00=00=00=CC=CC=CC,=00=00=00=00=01=00=01=00=00=
+=02=01L=00;=
+
+--BOUNDARY
+Content-Type: image/gif; name="bar.gif"
+Content-Disposition: inline; filename="bar.gif"
+Content-Transfer-Encoding: quoted-printable
+
+GIF89a=01=00=01=00=80=00=00=00=00=00=CC=CC=CC,=00=00=00=00=01=00=01=00=00=
+=02=01L=00;=
+
+--BOUNDARY--
|