Skip to content

Commit

Permalink
[Bromley] Only change endpoint config when needed.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Jun 29, 2020
1 parent f964e0f commit 96d13e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion perllib/FixMyStreet/Cobrand/Bromley.pm
Expand Up @@ -219,7 +219,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 {
Expand Down
6 changes: 5 additions & 1 deletion t/open311/post-service-request-updates.t
Expand Up @@ -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);
Expand All @@ -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,
Expand Down

0 comments on commit 96d13e9

Please sign in to comment.