From c2089e945132d36468f1d9a3bf08ae4d661cf44a Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 12 Feb 2019 14:01:38 +0000 Subject: Allow user to be associated with multiple areas. Update database to store an array of IDs rather than only one; consequential changes to the admin and the dashboard to allow selection. --- t/app/controller/dashboard.t | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 't/app/controller/dashboard.t') diff --git a/t/app/controller/dashboard.t b/t/app/controller/dashboard.t index a5fa8772a..37903513c 100644 --- a/t/app/controller/dashboard.t +++ b/t/app/controller/dashboard.t @@ -113,7 +113,7 @@ FixMyStreet::override_config { }; subtest 'area user can only see their area' => sub { - $counciluser->update({area_id => $area_id}); + $counciluser->update({area_ids => [ $area_id ]}); $mech->get_ok("/dashboard"); $mech->content_contains('

Trowbridge

'); @@ -122,7 +122,11 @@ FixMyStreet::override_config { $mech->get_ok("/dashboard?ward=$alt_area_id"); $mech->content_contains('

Trowbridge

'); - $counciluser->update({area_id => undef}); + $counciluser->update({area_ids => [ $area_id, $alt_area_id ]}); + $mech->get_ok("/dashboard"); + $mech->content_contains('

Bradford-on-Avon / Trowbridge

'); + + $counciluser->update({area_ids => undef}); }; subtest 'The correct categories and totals shown by default' => sub { -- cgit v1.2.3