diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-29 13:58:44 +0100 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-05-30 09:56:26 +0100 |
commit | ff0715db2d67bbf043a851ce7d9bed7e857c2db2 (patch) | |
tree | c09d569aec0efbcc18d27b1aec4dc453df251e68 | |
parent | f5b647053043afe0de18db327ea9ae4b6665daf2 (diff) |
[Buckinghamshire] Include Car parking category.
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Buckinghamshire.pm | 10 | ||||
-rw-r--r-- | t/cobrand/bucks.t | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm index f2467d248..8e463c688 100644 --- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm +++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm @@ -455,9 +455,15 @@ sub get_geocoder { 'OSM' } sub categories_restriction { my ($self, $rs) = @_; - # Buckinghamshire is a two-tier council, but only want to display + # Buckinghamshire is a two-tier council, but mostly want to display # county-level categories on their cobrand. - return $rs->search( [ { 'body_areas.area_id' => 2217 }, { category => 'Flytipping' } ], { join => { body => 'body_areas' } }); + return $rs->search( + [ + { 'body_areas.area_id' => 2217 }, + { category => [ 'Flytipping', 'Car Parks' ] }, + ], + { join => { body => 'body_areas' } } + ); } sub lookup_site_code_config { { diff --git a/t/cobrand/bucks.t b/t/cobrand/bucks.t index 892bf617d..6732eb29c 100644 --- a/t/cobrand/bucks.t +++ b/t/cobrand/bucks.t @@ -13,6 +13,7 @@ $mech->create_contact_ok(body_id => $body->id, category => 'Potholes', email => $mech->create_contact_ok(body_id => $body->id, category => 'Blocked drain', email => "DRA"); my $district = $mech->create_body_ok(2257, 'Chiltern'); +$mech->create_contact_ok(body_id => $district->id, category => 'Car Parks', email => "car\@chiltern"); $mech->create_contact_ok(body_id => $district->id, category => 'Flytipping', email => "flytipping\@chiltern"); $mech->create_contact_ok(body_id => $district->id, category => 'Graffiti', email => "graffiti\@chiltern"); @@ -37,6 +38,7 @@ subtest 'cobrand displays council name' => sub { subtest 'cobrand displays correct categories' => sub { my $json = $mech->get_ok_json('/report/new/ajax?latitude=51.615559&longitude=-0.556903'); is @{$json->{bodies}}, 2, 'Both Chiltern and Bucks returned'; + like $json->{category}, qr/Car Parks/, 'Car Parks displayed'; like $json->{category}, qr/Flytipping/, 'Flytipping displayed'; like $json->{category}, qr/Blocked drain/, 'Blocked drain displayed'; unlike $json->{category}, qr/Graffiti/, 'Graffiti not displayed'; |