aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--t/app/controller/report_updates.t40
-rw-r--r--templates/web/default/report/updates.html1
2 files changed, 41 insertions, 0 deletions
diff --git a/t/app/controller/report_updates.t b/t/app/controller/report_updates.t
index c4c50f4d1..c601fbbec 100644
--- a/t/app/controller/report_updates.t
+++ b/t/app/controller/report_updates.t
@@ -589,6 +589,46 @@ for my $test (
};
}
+subtest 'check meta correct for comments marked confirmed but not marked open' => sub {
+ $report->comments->delete;
+ my $comment = FixMyStreet::App->model('DB::Comment')->create(
+ {
+ user => $user,
+ problem_id => $report->id,
+ text => 'update text',
+ confirmed => DateTime->now,
+ problem_state => 'confirmed',
+ anonymous => 0,
+ mark_open => 0,
+ mark_fixed => 0,
+ state => 'confirmed',
+ }
+ );
+
+ $mech->get_ok( "/report/" . $report->id );
+ my $update_meta = $mech->extract_update_metas;
+ like $update_meta->[0], qr/marked as open$/,
+ 'update meta says marked as open';
+ unlike $update_meta->[0], qr/reopened$/,
+ 'update meta does not say reopened';
+
+ $comment->update( { mark_open => 1 } );
+ $mech->get_ok( "/report/" . $report->id );
+ my $update_meta = $mech->extract_update_metas;
+
+ unlike $update_meta->[0], qr/marked as open$/,
+ 'update meta does not says marked as open';
+ like $update_meta->[0], qr/reopened$/, 'update meta does say reopened';
+
+ $comment->update( { mark_open => 0, problem_state => undef } );
+ $mech->get_ok( "/report/" . $report->id );
+ my $update_meta = $mech->extract_update_metas;
+
+ unlike $update_meta->[0], qr/marked as open$/,
+ 'update meta does not says marked as open';
+ unlike $update_meta->[0], qr/reopened$/, 'update meta does not say reopened';
+ };
+
$user->from_council(0);
$user->update;
diff --git a/templates/web/default/report/updates.html b/templates/web/default/report/updates.html
index 2f935285a..64373b70b 100644
--- a/templates/web/default/report/updates.html
+++ b/templates/web/default/report/updates.html
@@ -27,6 +27,7 @@
[%- ELSE %]
[%- ", " _ loc( 'reopened' ) IF update.mark_open %]
[%- ", " _ tprintf(loc( 'marked as %s' ), update.meta_problem_state) IF update.problem_state AND update.problem_state != 'confirmed' %]
+ [%- ", " _ loc( 'marked as open' ) IF NOT update.mark_open AND update.problem_state == 'confirmed' %]
[%- END %]
[% END %]