diff options
-rw-r--r-- | perllib/FixMyStreet/Cobrand/UKCouncils.pm | 6 | ||||
-rw-r--r-- | t/cobrand/isleofwight.t | 13 |
2 files changed, 18 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/Cobrand/UKCouncils.pm b/perllib/FixMyStreet/Cobrand/UKCouncils.pm index 9f4610143..5f45609bb 100644 --- a/perllib/FixMyStreet/Cobrand/UKCouncils.pm +++ b/perllib/FixMyStreet/Cobrand/UKCouncils.pm @@ -179,7 +179,11 @@ sub reports_body_check { } # We want to make sure we're only on our page. - unless ( $self->council_name =~ /^\Q$code\E/ ) { + my $council_name = $self->council_name; + if (my $override = $self->all_reports_single_body) { + $council_name = $override->{name}; + } + unless ( $council_name =~ /^\Q$code\E/ ) { $c->res->redirect( 'https://www.fixmystreet.com' . $c->req->uri->path_query, 301 ); $c->detach(); } diff --git a/t/cobrand/isleofwight.t b/t/cobrand/isleofwight.t index a3f10fce3..2f5b02337 100644 --- a/t/cobrand/isleofwight.t +++ b/t/cobrand/isleofwight.t @@ -29,6 +29,19 @@ my @reports = $mech->create_problems_for_body(1, $isleofwight->id, 'An Isle of w user => $user }); +subtest "check clicking all reports link" => sub { + FixMyStreet::override_config { + MAPIT_URL => 'http://mapit.uk/', + ALLOWED_COBRANDS => 'isleofwight', + }, sub { + $mech->get_ok('/'); + $mech->follow_link_ok({ text => 'All reports' }); + }; + + $mech->content_contains("An Isle of wight report", "Isle of Wight report there"); + $mech->content_contains("Island Roads", "is still on cobrand"); +}; + subtest "only original reporter can comment" => sub { FixMyStreet::override_config { MAPIT_URL => 'http://mapit.uk/', |