Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions perllib/FixMyStreet/Cobrand/UKCouncils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,12 @@ sub munge_report_new_bodies {
%$bodies = map { $_->id => $_ } grep { $_->name ne 'Environment Agency' } values %$bodies;
}

# Remove Canals and Rivers Trust from showing on Cobrands during development work
# Canals & River Trust overrides this function
if ( $bodies{'Canal & River Trust'} ) {
%$bodies = map { $_->id => $_ } grep { $_->name ne 'Canal & River Trust' } values %$bodies;
}

if ( $bodies{'Thamesmead'} ) {
my $thamesmead = FixMyStreet::Cobrand::Thamesmead->new({ c => $self->{c} });
$thamesmead->munge_thamesmead_body($bodies);
Expand Down
14 changes: 14 additions & 0 deletions t/cobrand/camden.t
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,18 @@ FixMyStreet::override_config {
};
};

FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'camden', 'tfl', 'canalrivertrust' ],
MAPIT_URL => 'http://mapit.uk/',
}, sub {
subtest 'cobrand does not show Canal and River trust categories' => sub {
my $canalsandriver = $mech->create_body_ok(CAMDEN_MAPIT_ID, 'Canal & River Trust');
my $canal_contact = $mech->create_contact_ok(body_id => $canalsandriver->id, category => 'Polluted water', email => 'water@example.com');
my $tree_contact = $mech->create_contact_ok(body_id => $camden->id, category => 'Trees', email => 'foo@camden');
$mech->get_ok("/report/new/ajax?latitude=51.529432&longitude=-0.124514");
$mech->content_contains('Trees');
$mech->content_lacks('Polluted water');
};
};

done_testing;
Loading