-
-
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! [Bucks] Add email alternative to templates
- Loading branch information
1 parent
4951f17
commit c6b1cc4
Showing
3 changed files
with
32 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,6 +87,27 @@ subtest "test report creation with initial auto-update and alternative email tex | |
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"; | ||
|
||
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("Template email response: Thanks for your report. | ||
This is the email alternative.", "Extra template email text displayed"); | ||
my $update_id = $report->comments->first->id; | ||
$mech->get_ok("/admin/update_edit/$update_id"); | ||
$mech->content_contains("<label for='email_detail'>Template email response:</label> | ||
<textarea class='form-control' name='email_detail' id='email_detail' cols=60 rows=10 readonly>Thanks for your report. | ||
This is the email alternative.</textarea></li>", "Extra template email text displayed"); | ||
$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"); | ||
$mech->content_contains("Non-template update", 'Standard update text visible'); | ||
$mech->content_lacks("Template email response:", 'Template email munged text not added'); | ||
$mech->get_ok("/admin/update_edit/$update_id"); | ||
$mech->content_contains("Text:", 'Text box shown for standard update'); | ||
$mech->content_lacks("Template email response:", 'Email text box not shown for standard update'); | ||
}; | ||
|
||
done_testing; | ||
|
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