aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2020-05-11 16:56:46 +0100
committerMatthew Somerville <matthew@mysociety.org>2020-05-26 23:02:03 +0100
commit901834444846905c85e56528b020bd1a667cb5d2 (patch)
treea73381ffcfc590d0e0faa70b23473e6f9d99079c /t/app/controller
parent72809e405e690c88d0e2011802820c9ba215ef61 (diff)
Make sure category shown in all its groups.
When compiling the reporting category dropdown, only one instance of each value was used. But if a value appears twice, from two different bodies, in different groups, it would then not appear in all the groups it would be expected to. Make sure we update the list of groups of the category if we come across another with the same value.
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/report_new.t4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/app/controller/report_new.t b/t/app/controller/report_new.t
index d2da75f2c..6af709c2c 100644
--- a/t/app/controller/report_new.t
+++ b/t/app/controller/report_new.t
@@ -641,10 +641,10 @@ subtest "category groups" => sub {
}
}, sub {
$contact2->update( { extra => { group => ['Roads','Pavements'] } } );
- $contact9->update( { extra => { group => 'Roads' } } );
+ $contact9->update( { extra => { group => 'Pavements' } } );
$contact10->update( { extra => { group => 'Roads' } } );
$mech->get_ok("/report/new?lat=$saved_lat&lon=$saved_lon");
- $mech->content_like(qr{<optgroup label="Pavements">\s*<option value='Potholes'>Potholes</option></optgroup>});
+ $mech->content_like(qr{<optgroup label="Pavements">\s*<option value='Potholes'>Potholes</option>\s*<option value='Street lighting'>Street lighting</option></optgroup>});
$mech->content_like(qr{<optgroup label="Roads">\s*<option value='Potholes'>Potholes</option>\s*<option value='Street lighting'>Street lighting</option></optgroup>});
};
};