diff options
author | Dave Arter <davea@mysociety.org> | 2016-08-01 12:03:45 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2016-08-01 12:03:45 +0100 |
commit | 1af9684e54aedb7f9935cdc4d38a28c61ec7d1f5 (patch) | |
tree | d6b044f54e070f8dbf265083534e849eb9ad6ead /t/cobrand | |
parent | 14aaf6fafaa9aa8736f49851e95fa2c3c566c056 (diff) | |
parent | 27e0c74321f48f9997745bf00647e3958f34d8e2 (diff) |
Merge branch '1281-html-emails'
Diffstat (limited to 't/cobrand')
-rw-r--r-- | t/cobrand/bromley.t | 7 | ||||
-rw-r--r-- | t/cobrand/fixamingata.t | 11 |
2 files changed, 9 insertions, 9 deletions
diff --git a/t/cobrand/bromley.t b/t/cobrand/bromley.t index 6066c66b6..e39bcbe4c 100644 --- a/t/cobrand/bromley.t +++ b/t/cobrand/bromley.t @@ -103,10 +103,9 @@ for my $test ( }; $mech->content_contains('Nearly done! Now check your email'); - my $email = $mech->get_email; - ok $email, "got an email"; - like $email->body, qr/This update will be sent to Bromley Council/i, "Email indicates problem will be sent to Bromley"; - unlike $email->body, qr/Note that we do not send updates to/i, "Email does not say updates aren't sent to Bromley"; + my $body = $mech->get_text_body_from_email; + like $body, qr/This update will be sent to Bromley Council/i, "Email indicates problem will be sent to Bromley"; + unlike $body, qr/Note that we do not send updates to/i, "Email does not say updates aren't sent to Bromley"; my $unreg_user = FixMyStreet::App->model( 'DB::User' )->find( { email => 'unregistered@example.com' } ); diff --git a/t/cobrand/fixamingata.t b/t/cobrand/fixamingata.t index 0cf7a31fe..2ef3c09b4 100644 --- a/t/cobrand/fixamingata.t +++ b/t/cobrand/fixamingata.t @@ -46,10 +46,11 @@ FixMyStreet::override_config { FixMyStreet::DB->resultset('Problem')->send_reports(); }; my $email = $mech->get_email; -like $email->header('Content-Type'), qr/utf-8/, 'encoding looks okay'; +my $plain = $mech->get_text_body_from_email($email, 1); +like $plain->header('Content-Type'), qr/utf-8/, 'encoding looks okay'; like $email->header('Subject'), qr/Ny rapport: Test Test/, 'subject looks okay'; like $email->header('To'), qr/other\@example.org/, 'to line looks correct'; -like $email->body_str, qr/V\xe4nligen,/, 'signature looks correct'; +like $plain->body_str, qr/V\xe4nligen,/, 'signature looks correct'; $mech->clear_emails_ok; my $user = @@ -89,10 +90,10 @@ FixMyStreet::override_config { FixMyStreet::DB->resultset('AlertType')->email_alerts(); }; -$mech->email_count_is(1); $email = $mech->get_email; -like $email->header('Content-Type'), qr/utf-8/, 'encoding looks okay'; -like $email->body_str, qr/V\xe4nligen,/, 'signature looks correct'; +$plain = $mech->get_text_body_from_email($email, 1); +like $plain->header('Content-Type'), qr/utf-8/, 'encoding looks okay'; +like $plain->body_str, qr/V\xe4nligen,/, 'signature looks correct'; $mech->clear_emails_ok; subtest "Test ajax decimal points" => sub { |