diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-06-23 16:42:42 +0100 |
---|---|---|
committer | M Somerville <matthew-github@dracos.co.uk> | 2020-11-11 10:29:20 +0000 |
commit | 09209f4168fed34837d11fb828aec33523b71737 (patch) | |
tree | 1c062aaaed9aa83159e9a517ac56c8245c1624a6 | |
parent | b8fb6677b54f99e53105de0e242be94969a53567 (diff) |
[Bromley] Only change endpoint config when needed.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Bromley.pm | 2 | ||||
-rw-r--r-- | t/open311/post-service-request-updates.t | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Bromley.pm b/perllib/FixMyStreet/Cobrand/Bromley.pm index 24210e3d6..ff2a80b21 100644 --- a/perllib/FixMyStreet/Cobrand/Bromley.pm +++ b/perllib/FixMyStreet/Cobrand/Bromley.pm @@ -224,7 +224,7 @@ sub open311_config_updates { $params->{endpoints} = { service_request_updates => 'update.xml', update => 'update.xml' - }; + } if $params->{endpoint} =~ /bromley.gov.uk/; } sub open311_pre_send { diff --git a/t/open311/post-service-request-updates.t b/t/open311/post-service-request-updates.t index 75711bd2d..03fcbeae4 100644 --- a/t/open311/post-service-request-updates.t +++ b/t/open311/post-service-request-updates.t @@ -16,7 +16,10 @@ my $params = { endpoint => 'endpoint', jurisdiction => 'home', }; -my $bromley = $mech->create_body_ok(2482, 'Bromley', { %$params, send_extended_statuses => 1, can_be_devolved => 1 }); +my $bromley = $mech->create_body_ok(2482, 'Bromley', { %$params, + endpoint => 'www.bromley.gov.uk', + send_extended_statuses => 1, + can_be_devolved => 1 }); my $oxon = $mech->create_body_ok(2237, 'Oxfordshire', { %$params, id => "5" . $bromley->id }); my $bucks = $mech->create_body_ok(2217, 'Buckinghamshire', $params); my $lewisham = $mech->create_body_ok(2492, 'Lewisham', $params); @@ -34,6 +37,7 @@ subtest 'Check Open311 params' => sub { my %conf = $o->open311_params($bromley); is_deeply \%conf, { %$result, + endpoint => 'www.bromley.gov.uk', extended_statuses => 1, endpoints => { service_request_updates => 'update.xml', update => 'update.xml' }, fixmystreet_body => $bromley, |