aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/report_inspect.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2017-05-26 13:45:24 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2017-05-26 13:45:24 +0100
commit565b32d48bb364ec7097faff01a2eabb336e72c9 (patch)
tree108763e0db6227b874084c823a8602d200c7cda9 /t/app/controller/report_inspect.t
parent83bc0e1ef5b99b1ffc1e77fe6a8eaccae146806a (diff)
parent9e7c44777e9fbcbef6be463b4a7a1dc9b20d90f1 (diff)
Merge branch 'issues/forcouncils/191-action-scheduled-instruct'
Diffstat (limited to 't/app/controller/report_inspect.t')
-rw-r--r--t/app/controller/report_inspect.t24
1 files changed, 22 insertions, 2 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t
index 00b4e3b38..e1723b0cd 100644
--- a/t/app/controller/report_inspect.t
+++ b/t/app/controller/report_inspect.t
@@ -221,12 +221,32 @@ FixMyStreet::override_config {
subtest "Oxfordshire-specific traffic management options are shown" => sub {
$report->update({ state => 'confirmed' });
$mech->get_ok("/report/$report_id");
- $mech->submit_form_ok({ button => 'save', with_fields => { traffic_information => 'Signs and Cones', state => 'Action Scheduled', include_update => undef } });
+ $mech->submit_form_ok({ button => 'save', with_fields => { traffic_information => 'Signs and Cones', state => 'Investigating', include_update => undef } });
$report->discard_changes;
- is $report->state, 'action scheduled', 'report state changed';
+ is $report->state, 'investigating', 'report state changed';
is $report->get_extra_metadata('traffic_information'), 'Signs and Cones', 'report data changed';
};
+ subtest "Action scheduled only shown appropriately" => sub {
+ $report->update({ state => 'confirmed' });
+ $mech->get_ok("/report/$report_id");
+ $mech->content_lacks('action scheduled');
+
+ # If the report is already in that state, though, we should show it
+ $report->update({ state => 'action scheduled' });
+ $mech->get_ok("/report/$report_id");
+ $mech->content_unlike(qr/<optgroup label="Scheduled">\s*<option value="action scheduled">Action Scheduled<\/option>/);
+ $mech->content_contains('<option selected value="action scheduled">Action Scheduled</option>');
+
+ $user->user_body_permissions->create({ body => $oxon, permission_type => 'report_instruct' });
+ $mech->get_ok("/report/$report_id");
+ $mech->content_like(qr/<optgroup label="Scheduled">\s*<option selected value="action scheduled">Action Scheduled<\/option>/);
+
+ $report->update({ state => 'confirmed' });
+ $mech->get_ok("/report/$report_id");
+ $mech->content_like(qr/<optgroup label="Scheduled">\s*<option value="action scheduled">Action Scheduled<\/option>/);
+ };
+
};
FixMyStreet::override_config {