aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-05 17:53:51 +0100
committerStruan Donald <struan@exo.org.uk>2018-04-11 10:42:52 +0100
commitdfc361813c6a7412d70b8782e29e712b4f06bba2 (patch)
tree79313b81a225295771862837722246afe3c78b48 /t/app/controller
parent80754df967ceee0180679ffcdde55d22aad4ac21 (diff)
admin UI to configure fetch_all_problems Open311 option
UI to update the fetch_all_problems setting in extra for a body. This also adds handling for extra body values in the Admin in a similar manner to the way other body params are handled.
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/admin/bodies.t39
1 files changed, 39 insertions, 0 deletions
diff --git a/t/app/controller/admin/bodies.t b/t/app/controller/admin/bodies.t
index 9bdf8fb9a..a485d286d 100644
--- a/t/app/controller/admin/bodies.t
+++ b/t/app/controller/admin/bodies.t
@@ -150,6 +150,45 @@ subtest 'check open311 configuring' => sub {
is $conf->endpoint, 'http://example.org/open311', 'endpoint updated';
is $conf->api_key, 'new api key', 'api key updated';
is $conf->jurisdiction, 'open311', 'jurisdiction configures';
+ ok !$conf->get_extra_metadata('fetch_all_problems'), 'fetch all problems unset';
+
+ $mech->form_number(3);
+ $mech->submit_form_ok(
+ {
+ with_fields => {
+ api_key => 'new api key',
+ endpoint => 'http://example.org/open311',
+ jurisdiction => 'open311',
+ send_comments => 0,
+ send_method => 'Open311',
+ fetch_all_problems => 1,
+ }
+ }
+ );
+
+ $mech->content_contains('Values updated');
+
+ $conf = FixMyStreet::App->model('DB::Body')->find( $body->id );
+ ok $conf->get_extra_metadata('fetch_all_problems'), 'fetch all problems set';
+
+ $mech->form_number(3);
+ $mech->submit_form_ok(
+ {
+ with_fields => {
+ api_key => 'new api key',
+ endpoint => 'http://example.org/open311',
+ jurisdiction => 'open311',
+ send_comments => 0,
+ send_method => 'Open311',
+ fetch_all_problems => 0,
+ }
+ }
+ );
+
+ $mech->content_contains('Values updated');
+
+ $conf = FixMyStreet::App->model('DB::Body')->find( $body->id );
+ ok !$conf->get_extra_metadata('fetch_all_problems'), 'fetch all problems unset';
};
subtest 'check text output' => sub {