diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_inspect.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 9d2ae0b0f..e1723b0cd 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -227,13 +227,23 @@ FixMyStreet::override_config { is $report->get_extra_metadata('traffic_information'), 'Signs and Cones', 'report data changed'; }; - subtest "No action scheduled without the right permission" => sub { + 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>/); }; |