diff options
author | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-12 14:01:38 +0000 |
---|---|---|
committer | Matthew Somerville <matthew-github@dracos.co.uk> | 2019-02-14 16:55:24 +0000 |
commit | c2089e945132d36468f1d9a3bf08ae4d661cf44a (patch) | |
tree | 755780edf643ebd8babb910632eb259623fd8a24 /t/app/controller/dashboard.t | |
parent | 1825a09bbdfee97928a251a84534d859b1a43387 (diff) |
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.
Diffstat (limited to 't/app/controller/dashboard.t')
-rw-r--r-- | t/app/controller/dashboard.t | 8 |
1 files changed, 6 insertions, 2 deletions
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('<h1>Trowbridge</h1>'); @@ -122,7 +122,11 @@ FixMyStreet::override_config { $mech->get_ok("/dashboard?ward=$alt_area_id"); $mech->content_contains('<h1>Trowbridge</h1>'); - $counciluser->update({area_id => undef}); + $counciluser->update({area_ids => [ $area_id, $alt_area_id ]}); + $mech->get_ok("/dashboard"); + $mech->content_contains('<h1>Bradford-on-Avon / Trowbridge</h1>'); + + $counciluser->update({area_ids => undef}); }; subtest 'The correct categories and totals shown by default' => sub { |