diff options
author | Edmund von der Burg <evdb@mysociety.org> | 2011-04-05 12:02:50 +0100 |
---|---|---|
committer | Edmund von der Burg <evdb@mysociety.org> | 2011-04-05 12:02:50 +0100 |
commit | c0b02b21a341b872449c9af029da69c7d87b27a7 (patch) | |
tree | 8216cd82d7270617371c38472ec904a0fcd62247 | |
parent | ffa8002e3fe36dba7e65b310e449c8ef9422f626 (diff) |
Don't hardcode email address
-rw-r--r-- | t/app/helpers/send_email.t | 5 | ||||
-rw-r--r-- | t/app/helpers/send_email_sample.txt | 2 |
2 files changed, 5 insertions, 2 deletions
diff --git a/t/app/helpers/send_email.t b/t/app/helpers/send_email.t index adf2c56c1..97006c7e2 100644 --- a/t/app/helpers/send_email.t +++ b/t/app/helpers/send_email.t @@ -39,6 +39,9 @@ is scalar(@emails), 1, "caught one email"; my $email_as_string = $emails[0]->as_string; ok $email_as_string =~ s{\s+Date:\s+\S.*?$}{}xms, "Found and stripped out date"; +my $expected_email_content = file(__FILE__)->dir->file('send_email_sample.txt')->slurp; +$expected_email_content =~ s{TESTING_EMAIL}{ FixMyStreet->config('TESTING_EMAIL') }e; + is $email_as_string, - file(__FILE__)->dir->file('send_email_sample.txt')->slurp, +$expected_email_content, "email is as expected"; diff --git a/t/app/helpers/send_email_sample.txt b/t/app/helpers/send_email_sample.txt index c6bdac74f..900f3103c 100644 --- a/t/app/helpers/send_email_sample.txt +++ b/t/app/helpers/send_email_sample.txt @@ -3,7 +3,7 @@ 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: evdb@ecclestoad.co.uk +From: TESTING_EMAIL Hello, |