aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_inspect.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-08-17 19:35:48 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-08-17 19:35:48 +0100
commit9495fe66792ce9733037e812f237bb2ccd7d96e6 (patch)
tree842c68f8042575b0bb988638fef6d9c8e0c81c76 /t/app/controller/report_inspect.t
parente020fe9e36b96b447d992f0d4a5ff2eaea34fcf3 (diff)
parent8b376fe18dc1994354ffd53314d6fbd20c562532 (diff)
Merge branch 'issues/forcouncils/201-show-all-report-updates'
Diffstat (limited to 't/app/controller/report_inspect.t')
-rw-r--r--t/app/controller/report_inspect.t16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t
index e668fddbf..33486aa28 100644
--- a/t/app/controller/report_inspect.t
+++ b/t/app/controller/report_inspect.t
@@ -79,10 +79,21 @@ FixMyStreet::override_config {
public_update => "This is a public update.", include_update => "1",
state => 'action scheduled', raise_defect => 1,
} });
+ $mech->get_ok("/report/$report_id");
+ $mech->submit_form_ok({ with_fields => {
+ update => "This is a second public update, of normal update form, no actual change.",
+ } });
$report->discard_changes;
- is $report->comments->first->text, "This is a public update.", 'Update was created';
+ my $comment = ($report->comments( undef, { order_by => { -desc => 'id' } } )->all)[1]->text;
+ is $comment, "This is a public update.", 'Update was created';
is $report->get_extra_metadata('inspected'), 1, 'report marked as inspected';
is $report->user->get_extra_metadata('reputation'), $reputation, "User reputation wasn't changed";
+ $mech->get_ok("/report/$report_id");
+ my $meta = $mech->extract_update_metas;
+ like $meta->[0], qr/Updated by .*action scheduled/, 'First update mentions action scheduled';
+ like $meta->[1], qr/Posted by .*defect raised/, 'Update mentions defect raised';
+ unlike $meta->[2], qr/Posted by .*action scheduled/, 'Update does not mention action scheduled';
+
$user->unset_extra_metadata('categories');
$user->update;
};
@@ -245,6 +256,9 @@ FixMyStreet::override_config {
} });
$report->discard_changes;
is $report->get_extra_metadata('inspected'), 1, 'report marked as inspected';
+ $mech->get_ok("/report/$report_id");
+ my $meta = $mech->extract_update_metas;
+ like $meta->[-1], qr/Updated by .*defect raised/, 'Update mentions defect raised';
};
subtest "Oxfordshire-specific traffic management options are shown" => sub {