diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 2 | ||||
-rw-r--r-- | perllib/FixMyStreet/Cobrand/FixMyStreet.pm | 2 | ||||
-rw-r--r-- | t/app/controller/around.t | 12 |
3 files changed, 14 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index ebb3d4839..f14d116cc 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -234,7 +234,7 @@ sub check_and_stash_category : Private { my @list_of_names = map { $_->name } values %bodies; my $csv = Text::CSV->new(); $csv->combine(@list_of_names); - $c->stash->{bodies} = \@bodies; + $c->stash->{around_bodies} = \@bodies; $c->{stash}->{list_of_names_as_string} = $csv->string; my $where = { body_id => [ keys %bodies ], }; diff --git a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm index 38e9e09a0..72ba51dd8 100644 --- a/perllib/FixMyStreet/Cobrand/FixMyStreet.pm +++ b/perllib/FixMyStreet/Cobrand/FixMyStreet.pm @@ -42,7 +42,7 @@ sub munge_around_category_where { my ($self, $where) = @_; my $user = $self->{c}->user; - my @iow = grep { $_->name eq 'Isle of Wight Council' } @{ $self->{c}->stash->{bodies} }; + my @iow = grep { $_->name eq 'Isle of Wight Council' } @{ $self->{c}->stash->{around_bodies} }; return unless @iow; # display all the categories on Isle of Wight at the moment as there's no way to diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 829d78ca3..7f88b13c1 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -137,6 +137,18 @@ subtest 'check non public reports are not displayed on around page' => sub { 'problem marked non public is not visible' ); }; +subtest 'check missing body message not shown when it does not need to be' => sub { + $mech->get_ok('/'); + FixMyStreet::override_config { + ALLOWED_COBRANDS => 'fixmystreet', + MAPIT_URL => 'http://mapit.uk/', + }, sub { + $mech->submit_form_ok( { with_fields => { pc => 'EH1 1BB' } }, + "good location" ); + }; + $mech->content_lacks('yet have details for the other councils that cover this location'); +}; + for my $permission ( qw/ report_inspect report_mark_private/ ) { subtest 'check non public reports are displayed on around page with $permission permission' => sub { my $body = FixMyStreet::DB->resultset('Body')->find( $body_edin_id ); |