aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
Diffstat (limited to 't/app')
-rw-r--r--t/app/model/alert_type.t25
-rw-r--r--t/app/model/problem.t4
2 files changed, 27 insertions, 2 deletions
diff --git a/t/app/model/alert_type.t b/t/app/model/alert_type.t
index ac8013278..ae413978f 100644
--- a/t/app/model/alert_type.t
+++ b/t/app/model/alert_type.t
@@ -487,6 +487,31 @@ subtest "check local alerts from cobrand send main site url for alerts for diffe
like $body, qr#$expected2#, 'cobrand area report point to cobrand url';
};
+# Test that email alerts are sent in the right language.
+subtest "correct i18n-ed summary for state of closed" => sub {
+ $mech->clear_emails_ok;
+
+ $report->update( { state => 'closed' } );
+ $alert->update( { lang => 'nb', cobrand => 'fiksgatami' } );
+
+ FixMyStreet::App->model('DB::AlertSent')->search( {
+ alert_id => $alert->id,
+ parameter => $comment->id,
+ } )->delete;
+
+ FixMyStreet::override_config {
+ ALLOWED_COBRANDS => [ 'fiksgatami' ],
+ }, sub {
+ FixMyStreet::App->model('DB::AlertType')->email_alerts();
+ };
+
+ $mech->email_count_is( 1 );
+ my $email = $mech->get_email;
+ my $body = $email->body;
+ my $msg = 'Denne rapporten er for tiden markert som lukket';
+ like $body, qr/$msg/, 'email says problem is closed, in Norwegian';
+};
+
END {
$mech->delete_user($user) if $user;
$mech->delete_user($user2) if $user2;
diff --git a/t/app/model/problem.t b/t/app/model/problem.t
index 7303eedac..fa8cf89ae 100644
--- a/t/app/model/problem.t
+++ b/t/app/model/problem.t
@@ -465,8 +465,8 @@ foreach my $test ( {
desc => 'email to two tier council',
unset_whendef => 1,
email_count => 1,
- to => qr'Gloucestershire County Council.*Cheltenham Borough Council',
- dear => qr'Dear Gloucestershire County Council and Cheltenham Borough',
+ to => qr'Cheltenham Borough Council.*Gloucestershire County Council',
+ dear => qr'Dear Cheltenham Borough Council and Gloucestershire County',
body => '2226,2326',
multiple => 1,
}, {