diff options
Diffstat (limited to 't/app/controller/around.t')
-rw-r--r-- | t/app/controller/around.t | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 784801517..ba5f8c48a 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -217,8 +217,8 @@ for my $permission ( qw/ report_inspect report_mark_private/ ) { subtest 'check assigned-only list items do not display shortlist buttons' => sub { my $body = FixMyStreet::DB->resultset('Body')->find( $body_edin_id ); - my $contact = $mech->create_contact_ok( category => 'Horses', body_id => $body->id, email => "horses\@example.org" ); - $edinburgh_problems[4]->update({ category => 'Horses' }); + my $contact = $mech->create_contact_ok( category => 'Horses & Ponies', body_id => $body->id, email => "horses\@example.org" ); + $edinburgh_problems[4]->update({ category => 'Horses & Ponies' }); my $user = $mech->log_in_ok( 'test@example.com' ); $user->set_extra_metadata(assigned_categories_only => 1); @@ -250,7 +250,10 @@ subtest 'check category, status and extra filtering works on /around' => sub { # Create one open and one fixed report in each category foreach my $category ( @$categories ) { my $contact = $mech->create_contact_ok( category => $category, body_id => $body->id, email => "$category\@example.org" ); - if ($category ne 'Pothole') { + if ($category eq 'Vegetation') { + $contact->set_extra_metadata(group => ['Environment', 'Green']); + $contact->update; + } elsif ($category eq 'Flytipping') { $contact->set_extra_metadata(group => ['Environment']); $contact->update; } @@ -281,6 +284,9 @@ subtest 'check category, status and extra filtering works on /around' => sub { $mech->get_ok( '/around?filter_group=Environment&bbox=' . $bbox ); $mech->content_contains('<option value="Flytipping" selected>'); + + $mech->get_ok( '/around?filter_group=Environment&filter_category=Vegetation&bbox=' . $bbox ); + $mech->content_like(qr/<optgroup label="Environment">.*?<option value="Vegetation" selected>.*?<optgroup label="Green">.*?<option value="Vegetation">/s); }; $json = $mech->get_ok_json( '/around?ajax=1&filter_category=Pothole&bbox=' . $bbox ); |