diff options
author | Dave Arter <davea@mysociety.org> | 2019-08-14 16:06:41 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2019-08-29 18:12:38 +0100 |
commit | 7570b9d1d95ec5a5ee58df69feab487be78831aa (patch) | |
tree | 3ae88581f4b97ec09e729395d5030bffaac2e6a8 /t/app/controller/report_new_open311.t | |
parent | 39fd4d22fec9425743b0a9ebced6d1b73c3d857b (diff) |
Add admin to disable reporting form per category.
Remove all existing hard-coded register_category calls, and have
a new way of implementing staff_ignore.
Diffstat (limited to 't/app/controller/report_new_open311.t')
-rw-r--r-- | t/app/controller/report_new_open311.t | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/t/app/controller/report_new_open311.t b/t/app/controller/report_new_open311.t index 3b733622b..a0f546788 100644 --- a/t/app/controller/report_new_open311.t +++ b/t/app/controller/report_new_open311.t @@ -287,4 +287,22 @@ subtest "Category extras includes description label for user" => sub { }; }; +subtest "Category extras includes form disabling string" => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => 'fixmystreet', + MAPIT_URL => 'http://mapit.uk/', + }, sub { + $contact4->push_extra_fields({ description => 'Please ring us!', code => 'ring', variable => 'false', order => '0', disable_form => 'true' }); + $contact4->update; + for ( + { url => '/report/new/ajax?' }, + { url => '/report/new/category_extras?category=Pothole' }, + ) { + my $json = $mech->get_ok_json($_->{url} . '&latitude=55.952055&longitude=-3.189579'); + my $output = $json->{by_category} ? $json->{by_category}{Pothole}{disable_form} : $json->{disable_form}; + is $output, 'Please ring us!'; + } + }; +}; + done_testing(); |