diff options
author | Chris Mytton <chrism@mysociety.org> | 2020-01-23 17:16:07 +0000 |
---|---|---|
committer | Chris Mytton <chrism@mysociety.org> | 2020-01-28 11:01:37 +0000 |
commit | 86c5ce6b9b0ac945d4939f132bcf7235ff3ce25f (patch) | |
tree | 99c3b15d6ccce38b3e69e26c8cfe1257fd6f344a /t | |
parent | 2d6af993630d9e43594975e093507ee62ed53b97 (diff) |
Allow multiple question to disable the new report form
This changes the existing logic to account for the fact that multiple
questions might have the disable form checkbox ticked for one of their
options.
At the moment this just displays one of the messages at a time, with the
first one taking priority. So if you have a "Is this an emergency"
question and a "Is this on private land" question which both disable the
form, and the user has selected "Yes" to both, then only the message for
the first question is displayed. This can potentially be improved in the
future, but seemed out of scope for this change.
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/report_new_open311.t | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/t/app/controller/report_new_open311.t b/t/app/controller/report_new_open311.t index 3488b96ce..dcad10899 100644 --- a/t/app/controller/report_new_open311.t +++ b/t/app/controller/report_new_open311.t @@ -378,9 +378,13 @@ subtest "Category extras includes form disabling string" => sub { my $output = $json->{by_category} ? $json->{by_category}{Pothole}{disable_form} : $json->{disable_form}; is_deeply $output, { all => 'Please ring us!', - message => 'Please please ring', - code => 'dangerous', - answers => [ 'yes' ], + questions => [ + { + message => 'Please please ring', + code => 'dangerous', + answers => [ 'yes' ], + }, + ], }; } |