Skip to content

Commit

Permalink
[Bexley] Communal/FAS take precedence for staff.
Browse files Browse the repository at this point in the history
Communal/flat above shop properties should always show
their location lists, for staff as well as public.
  • Loading branch information
dracos committed Jan 22, 2025
1 parent ec7b603 commit 2f242bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 5 additions & 6 deletions perllib/FixMyStreet/Cobrand/Bexley/Waste.pm
Original file line number Diff line number Diff line change
Expand Up @@ -1177,12 +1177,11 @@ sub _bin_location_field {
my $c = $self->{c};
my $property = $c->stash->{property};

my $type
= $c->stash->{is_staff}
|| $property->{has_assisted} ? 'staff_or_assisted'
: $property->{is_communal} ? 'communal'
: $property->{above_shop} ? 'above_shop'
: '';
my $type =
$property->{is_communal} ? 'communal'
: $property->{above_shop} ? 'above_shop'
: $c->stash->{is_staff} || $property->{has_assisted} ? 'staff_or_assisted'
: '';

my $options = _bin_location_options()->{$type};

Expand Down
8 changes: 8 additions & 0 deletions t/app/controller/waste_bexley.t
Original file line number Diff line number Diff line change
Expand Up @@ -727,6 +727,14 @@ FixMyStreet::override_config {
for
@{ FixMyStreet::Cobrand::Bexley::Waste::_bin_location_options()
->{staff_or_assisted} };

$mech->get_ok('/waste/10002/report');
$mech->content_contains('Bin location');
$mech->content_contains('name="bin_location"');
$mech->content_contains($_)
for
@{ FixMyStreet::Cobrand::Bexley::Waste::_bin_location_options()
->{communal} };
};

subtest 'Correct labels used when reporting missed collection' => sub {
Expand Down

0 comments on commit 2f242bd

Please sign in to comment.