diff options
author | Struan Donald <struan@exo.org.uk> | 2020-08-21 12:22:50 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2020-08-21 15:50:42 +0100 |
commit | 5430338004cc7169cec02ec83bf2e82683c8d907 (patch) | |
tree | b58ecf175c3ba24410484e389c1f9157b55af9ee /t/app/controller | |
parent | ba318964a69f20e583220bc81c70289d85cc7b6f (diff) |
[UK] hide change asset button if category drop downs hidden
The change asset button code relies on the category drop downs being visible
which requires either the change report category or inspect report
permissions. Hide the button if these are not present and only fire the
update button code if it's present.
Fixes mysociety/fixmystreet-commercial#1961
Diffstat (limited to 't/app/controller')
-rw-r--r-- | t/app/controller/report_inspect.t | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t index 48dceaf04..96325760c 100644 --- a/t/app/controller/report_inspect.t +++ b/t/app/controller/report_inspect.t @@ -56,12 +56,14 @@ FixMyStreet::override_config { $mech->content_lacks('Private'); $mech->content_lacks('Priority'); $mech->content_lacks('Traffic management'); + $mech->content_lacks('Change asset'); $mech->content_lacks('/admin/report_edit/'.$report_id.'">admin</a>)'); $user->user_body_permissions->create({ body => $oxon, permission_type => 'report_mark_private' }); $mech->get_ok("/report/$report_id"); $mech->content_contains('Private'); $mech->content_contains('Save changes'); + $mech->content_lacks('Change asset'); $mech->content_lacks('Priority'); $mech->content_lacks('Traffic management'); $mech->content_lacks('/admin/report_edit/'.$report_id.'">admin</a>)'); @@ -71,6 +73,7 @@ FixMyStreet::override_config { $mech->content_contains('Private'); $mech->content_contains('Save changes'); $mech->content_contains('Priority'); + $mech->content_lacks('Change asset'); $mech->content_lacks('Traffic management'); $mech->content_lacks('/admin/report_edit/'.$report_id.'">admin</a>)'); @@ -80,6 +83,7 @@ FixMyStreet::override_config { $mech->content_contains('Private'); $mech->content_contains('Priority'); $mech->content_contains('Traffic management'); + $mech->content_contains('Change asset'); $mech->content_lacks('/admin/report_edit/'.$report_id.'">admin</a>)'); }; |