aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/admin/report_edit.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
committerMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
commit377bd96aab7cad3434185c30eb908c9da447fe40 (patch)
tree7ec5527e205d5b62caaa862a7de8cd25199c8bf0 /t/app/controller/admin/report_edit.t
parent56f61b1441070aa0b9ddcfc74aca46c20313609f (diff)
parent92b253904062edd533e55c22824de6fd01e2f7c1 (diff)
Merge tag 'v2.6' into fiksgatami-dev
Diffstat (limited to 't/app/controller/admin/report_edit.t')
-rw-r--r--t/app/controller/admin/report_edit.t26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/app/controller/admin/report_edit.t b/t/app/controller/admin/report_edit.t
index 5e3e6c315..c6e03ff7e 100644
--- a/t/app/controller/admin/report_edit.t
+++ b/t/app/controller/admin/report_edit.t
@@ -608,6 +608,32 @@ subtest "Test display of report extra data" => sub {
$mech->content_contains('extra_field</strong>: this is extra data');
};
+subtest "Test alert count display" => sub {
+ $mech->get_ok("/admin/report_edit/$report_id");
+ $mech->content_contains('Alerts: 0');
+
+ my $alert = FixMyStreet::App->model('DB::Alert')->find_or_create(
+ {
+ alert_type => 'new_updates',
+ parameter => $report_id,
+ user => $user,
+ }
+ );
+
+ $mech->get_ok("/admin/report_edit/$report_id");
+ $mech->content_contains('Alerts: 0', 'does not include unconfirmed reports');
+
+ $alert->update( { confirmed => 1 } );
+ $mech->get_ok("/admin/report_edit/$report_id");
+ $mech->content_contains('Alerts: 1');
+
+ $alert->update( { whendisabled => \"now()" } );
+ $mech->get_ok("/admin/report_edit/$report_id");
+ $mech->content_contains('Alerts: 0');
+
+ $alert->delete;
+};
+
my $report2 = FixMyStreet::App->model('DB::Problem')->find_or_create(
{
postcode => 'SW1A 1AA',