diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/Buckinghamshire.pm | 12 | ||||
-rw-r--r-- | t/cobrand/bucks.t | 2 |
2 files changed, 11 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm index f2467d248..6a6da22b6 100644 --- a/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm +++ b/perllib/FixMyStreet/Cobrand/Buckinghamshire.pm @@ -45,7 +45,7 @@ sub on_map_default_status { 'open' } sub pin_colour { my ( $self, $p, $context ) = @_; - return 'grey' if $p->state eq 'not responsible'; + return 'grey' if $p->state eq 'not responsible' || !$self->owns_problem( $p ); return 'green' if $p->is_fixed || $p->is_closed; return 'red' if $p->state eq 'confirmed'; return 'yellow'; @@ -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'; |