diff options
Diffstat (limited to 't')
-rw-r--r-- | t/app/controller/admin/permissions.t | 4 | ||||
-rw-r--r-- | t/app/controller/admin/users.t | 14 | ||||
-rw-r--r-- | t/app/controller/dashboard.t | 8 |
3 files changed, 16 insertions, 10 deletions
diff --git a/t/app/controller/admin/permissions.t b/t/app/controller/admin/permissions.t index 3fc221a63..036ec4509 100644 --- a/t/app/controller/admin/permissions.t +++ b/t/app/controller/admin/permissions.t @@ -181,6 +181,7 @@ FixMyStreet::override_config { subtest "Unsetting user from_body removes all permissions and area " => sub { is $user2->user_body_permissions->count, 1, 'user2 has 1 permission'; + $user2->update({ area_ids => [123] }); # Set to check cleared $mech->get_ok("/admin/user_edit/$user2_id"); $mech->content_contains('Moderate report details'); @@ -204,8 +205,9 @@ FixMyStreet::override_config { "permissions[user_assign_areas]" => undef, } } ); + $user2->discard_changes; is $user2->user_body_permissions->count, 0, 'user2 has had permissions removed'; - is $user2->area_id, undef, 'user2 has had area removed'; + is $user2->area_ids, undef, 'user2 has had area removed'; }; }; diff --git a/t/app/controller/admin/users.t b/t/app/controller/admin/users.t index be781d3ae..d82a7eaef 100644 --- a/t/app/controller/admin/users.t +++ b/t/app/controller/admin/users.t @@ -209,7 +209,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -229,7 +229,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -249,7 +249,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -269,7 +269,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -289,7 +289,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => 'on', is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -309,7 +309,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => undef, - area_id => '', + area_ids => undef, %default_perms, }, changes => { @@ -332,7 +332,7 @@ FixMyStreet::override_config { phone_verified => undef, flagged => undef, is_superuser => 'on', - area_id => '', + area_ids => undef, }, changes => { is_superuser => undef, 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 { |