-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixup! fixup! fixup! [Bucks] Add email alternative to templates
- Loading branch information
1 parent
54a1366
commit f7200d5
Showing
4 changed files
with
13 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,7 @@ $template = FixMyStreet::DB->resultset("ResponseTemplate")->create({ | |
text => 'Thanks for your report. We will investigate within 5 working days.', | ||
email_text => 'Thanks for your report. | ||
This is the email alternative.', | ||
This is the email <a href="https://google.com">alternative</a>.', | ||
auto_response => 1, | ||
}); | ||
|
||
|
@@ -85,17 +85,17 @@ subtest "test report creation with initial auto-update and alternative email tex | |
my ($email_for_subscriber) = grep { $_->header('To') =~ /test-3/ } @emails; | ||
|
||
is $mech->get_text_body_from_email($email_for_subscriber) =~ /Thanks for your report. We will investigate within 5 working days./, 1, "Text template sent to subscriber"; | ||
is $mech->get_text_body_from_email($email_for_reporter) =~ /This is the email alternative/, 1, "Email template sent to reporter"; | ||
is $mech->get_html_body_from_email($email_for_reporter) =~ /<p style="margin: 0 0 16px 0;">\r\nThis is the email alternative.<\/p>/, 1, "Email template text in paragraphs"; | ||
is $mech->get_text_body_from_email($email_for_reporter) =~ /This is the email alternative \[https:\/\/google.com\]/, 1, "Email template sent to reporter"; | ||
is $mech->get_html_body_from_email($email_for_reporter) =~ /<p style="margin: 0 0 16px 0;">\r\nThis is the email <a href\="https:\/\/google\.com">alternative<\/a>.<\/p>/, 1, "Email template text in paragraphs"; | ||
|
||
my $counciluser = $mech->create_user_ok('[email protected]', name => 'Council User', from_body => $body, is_superuser => 1); | ||
$mech->log_in_ok($counciluser->email); | ||
$mech->get_ok("/admin/report_edit/$report_id"); | ||
$mech->content_contains("This is the email alternative.", "Extra template email text displayed"); | ||
$mech->content_contains('This is the email ', "Extra template email text displayed"); | ||
my $update_id = $report->comments->first->id; | ||
$mech->get_ok("/admin/update_edit/$update_id"); | ||
$mech->content_contains("Template email response:", "Template email input present"); | ||
$mech->content_contains("This is the email alternative.", "Template email input populated"); | ||
$mech->content_contains("This is the email ", "Template email input populated"); | ||
$report->comments->first->delete; | ||
$update_id = $mech->create_comment_for_problem($report, $comment_user, 'User', 'Non-template update', 0, 'confirmed', 'confirmed')->id; | ||
$mech->get_ok("/admin/report_edit/$report_id"); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters