aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-10-26 17:01:56 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-10-26 17:20:11 +0100
commit50379992dc95e242fd29f6e3473c70f2106749bc (patch)
treec460b1b425ccf58720566cbfb72e79163eb471a0 /t/cobrand
parentb42f354d5c4ad7f237a826033c3c176821e4a085 (diff)
Error if logged-in user visits admin without permission.
This is less confusing than redirecting to /auth and then to /my (as they're logged in). Fixes #1566.
Diffstat (limited to 't/cobrand')
-rw-r--r--t/cobrand/zurich.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/cobrand/zurich.t b/t/cobrand/zurich.t
index 1ea55b003..b59e546dd 100644
--- a/t/cobrand/zurich.t
+++ b/t/cobrand/zurich.t
@@ -138,8 +138,8 @@ FixMyStreet::override_config {
my $user = $mech->log_in_ok( 'dm1@example.org') ;
$user->from_body( undef );
$user->update;
- $mech->get_ok( '/admin' );
- is $mech->uri->path, '/my', "got sent to /my";
+ ok $mech->get( '/admin' );
+ is $mech->res->code, 403, 'Got 403';
$user->from_body( $division->id );
$user->update;
@@ -361,9 +361,9 @@ subtest 'SDM' => sub {
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'zurich' ],
}, sub {
- $mech->get_ok( '/admin' );
+ ok $mech->get( '/admin' );
};
- is $mech->uri->path, '/my', "got sent to /my";
+ is $mech->res->code, 403, 'Got 403';
$user->from_body( $subdivision->id );
$user->update;