aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/contact.t
diff options
context:
space:
mode:
authorDave Arter <davea@mysociety.org>2016-08-01 12:03:45 +0100
committerDave Arter <davea@mysociety.org>2016-08-01 12:03:45 +0100
commit1af9684e54aedb7f9935cdc4d38a28c61ec7d1f5 (patch)
treed6b044f54e070f8dbf265083534e849eb9ad6ead /t/app/controller/contact.t
parent14aaf6fafaa9aa8736f49851e95fa2c3c566c056 (diff)
parent27e0c74321f48f9997745bf00647e3958f34d8e2 (diff)
Merge branch '1281-html-emails'
Diffstat (limited to 't/app/controller/contact.t')
-rw-r--r--t/app/controller/contact.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/app/controller/contact.t b/t/app/controller/contact.t
index 1b0f09a85..dd94fc431 100644
--- a/t/app/controller/contact.t
+++ b/t/app/controller/contact.t
@@ -251,16 +251,16 @@ for my $test (
}
$mech->submit_form_ok( { with_fields => $test->{fields} } );
$mech->content_contains('Thank you for your feedback');
- $mech->email_count_is(1);
my $email = $mech->get_email;
is $email->header('Subject'), 'FMS message: ' . $test->{fields}->{subject}, 'subject';
is $email->header('From'), "\"$test->{fields}->{name}\" <$test->{fields}->{em}>", 'from';
- like $email->body, qr/$test->{fields}->{message}/, 'body';
- like $email->body, qr/Sent by contact.cgi on \S+. IP address (?:\d{1,3}\.){3,}\d{1,3}/, 'body footer';
+ my $body = $mech->get_text_body_from_email($email);
+ like $body, qr/$test->{fields}->{message}/, 'body';
+ like $body, qr/Sent by contact.cgi on \S+. IP address (?:\d{1,3}\.){3,}\d{1,3}/, 'body footer';
my $problem_id = $test->{fields}{id};
- like $email->body, qr/Complaint about report $problem_id/, 'reporting a report'
+ like $body, qr/Complaint about report $problem_id/, 'reporting a report'
if $test->{fields}{id};
$problem_main->discard_changes;