aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorChris Mytton <self@hecticjeff.net>2013-09-11 18:35:21 +0100
committerChris Mytton <self@hecticjeff.net>2013-09-11 18:35:21 +0100
commit1f5c75fde567bccca3d51ad57bc8f01274e8d114 (patch)
treefa0859241bdcb64f7f7b60cc4a20cc6be245c0e5 /t
parentdb49e8c4595898c79eaac46be091ff280f93b25f (diff)
[Zurich] Test rejected email are only sent when requested
Diffstat (limited to 't')
-rw-r--r--t/cobrand/zurich.t16
1 files changed, 16 insertions, 0 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index 721e6517a..875a4262c 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -251,6 +251,22 @@ $mech->get_ok( '/admin/bodies' );
$mech->content_lacks( '<form method="post" action="bodies"' );
$mech->log_out_ok;
+# Test hidden report email are only sent when requested
+$user = $mech->log_in_ok( 'dm1@example.org') ;
+my $extra = $report->extra;
+$extra->{email_confirmed} = 1;
+$report->extra ( { %$extra } );
+$report->update;
+$mech->get_ok( '/admin/report_edit/' . $report->id );
+$mech->submit_form_ok( { with_fields => { state => 'hidden', send_rejected_email => 1 } } );
+$mech->email_count_is(1);
+$mech->clear_emails_ok;
+$mech->get_ok( '/admin/report_edit/' . $report->id );
+$mech->submit_form_ok( { with_fields => { state => 'hidden', send_rejected_email => undef } } );
+$mech->email_count_is(0);
+$mech->clear_emails_ok;
+$mech->log_out_ok;
+
$mech->delete_problems_for_body( 2 );
$mech->delete_user( 'dm1@example.org' );
$mech->delete_user( 'sdm1@example.org' );