aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2018-06-22 12:56:37 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2018-06-22 13:43:27 +0100
commitd268f042ce441485b3512308055f37bd08c63588 (patch)
tree3d58ded28da73a38c2b31dc7c9a14ef2edb72694 /t
parentbbeb8db833e20bf956bd04700f7c6123e942c92d (diff)
Allow inspector to unset priority.
Diffstat (limited to 't')
-rw-r--r--t/app/controller/report_inspect.t20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/app/controller/report_inspect.t b/t/app/controller/report_inspect.t
index 6a001225d..260339da8 100644
--- a/t/app/controller/report_inspect.t
+++ b/t/app/controller/report_inspect.t
@@ -414,6 +414,26 @@ FixMyStreet::override_config {
is $report->response_priority, undef, 'response priority set';
};
+ subtest "check can unset priority" => sub {
+ $report->discard_changes;
+ $report->update({ category => 'Cows', response_priority_id => $rp->id });
+ $report->discard_changes;
+ is $report->response_priority->id, $rp->id, 'response priority set';
+ $user->user_body_permissions->delete;
+ $user->user_body_permissions->create({ body => $oxon, permission_type => 'report_edit_category' });
+ $user->user_body_permissions->create({ body => $oxon, permission_type => 'report_edit_priority' });
+ $mech->get_ok("/report/$report_id");
+ $mech->submit_form_ok({
+ button => 'save',
+ with_fields => {
+ priority => "",
+ }
+ });
+
+ $report->discard_changes;
+ is $report->response_priority, undef, 'response priority unset';
+ };
+
subtest "check nearest address display" => sub {
$mech->get_ok("/report/$report_id");
$mech->content_lacks('Nearest calculated address', 'No address displayed');