diff options
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Reports.pm | 2 | ||||
-rw-r--r-- | t/app/controller/reports.t | 23 |
2 files changed, 24 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Reports.pm b/perllib/FixMyStreet/App/Controller/Reports.pm index 25d5cd82e..9dc0ad6bc 100644 --- a/perllib/FixMyStreet/App/Controller/Reports.pm +++ b/perllib/FixMyStreet/App/Controller/Reports.pm @@ -121,7 +121,7 @@ sub ward : Path : Args(2) { $c->stash->{stats} = $c->cobrand->get_report_stats(); - my @categories = $c->stash->{body}->contacts->search( undef, { + my @categories = $c->stash->{body}->contacts->not_deleted->search( undef, { columns => [ 'category' ], distinct => 1, order_by => [ 'category' ], diff --git a/t/app/controller/reports.t b/t/app/controller/reports.t index ecb43f447..02625fcc7 100644 --- a/t/app/controller/reports.t +++ b/t/app/controller/reports.t @@ -216,5 +216,28 @@ subtest "test fiksgatami all reports page" => sub { } }; +subtest "test greenwich all reports page" => sub { + FixMyStreet::override_config { + ALLOWED_COBRANDS => [ 'greenwich' ], + MAPIT_URL => 'http://mapit.mysociety.org/' + }, sub { + my $body = $mech->create_body_ok(2493, 'Royal Borough of Greenwich'); + my $deleted_contact = $mech->create_contact_ok( + body_id => $body->id, + category => 'Deleted', + email => 'deleted@example.com', + deleted => 1 + ); + ok $mech->host("greenwich.fixmystreet.com"), 'change host to greenwich'; + $mech->get_ok('/reports/Royal+Borough+of+Greenwich'); + # There should not be deleted categories in the list + my $category_select = $mech->forms()->[0]->find_input('filter_category'); + is $category_select->possible_values, 1, 'deleted categories are not shown'; + + # Clean up after the test + $deleted_contact->delete; + } +}; + done_testing(); |