aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/around.t
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-07-16 20:35:46 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-07-16 20:35:46 +0100
commitd1dc00d5f911809f2e1e5a2b8ff383164914e94d (patch)
tree2994fb39a83ddcdfc69ad674c7e58b35c86ff12b /t/app/controller/around.t
parent4dfbdeb587859855180e7fb058278f61d7be7fb2 (diff)
parent859fe1336c653bc3a533fd7f1be23cc56b61c03c (diff)
Merge branch '3110-deep-linking-category-group'
Diffstat (limited to 't/app/controller/around.t')
-rw-r--r--t/app/controller/around.t12
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 );