diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-05-19 12:05:05 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2017-05-26 12:41:32 +0100 |
commit | 36baff2d6ea23dc6648160ce82e40e0e9f6d7bda (patch) | |
tree | 75180d941c49e6e20661ec97bad4c78feef97165 /t | |
parent | 018193054d34778488ed8e5a1669eb9e03c317cd (diff) |
[Oxfordshire] Use instruct perm to filter state.
Without the report_instruct permission, the 'action scheduled'
state is not an option in the dropdown.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_inspect.t | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 00b4e3b38..9d2ae0b0f 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -221,12 +221,22 @@ 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 "No action scheduled without the right permission" => sub { + $report->update({ state => 'confirmed' }); + $mech->get_ok("/report/$report_id"); + $mech->content_lacks('action scheduled'); + + $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 value="action scheduled">Action Scheduled<\/option>/); + }; + }; FixMyStreet::override_config { |