aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller/root.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
committerMarius Halden <marius.h@lden.org>2019-10-30 19:28:55 +0100
commit377bd96aab7cad3434185c30eb908c9da447fe40 (patch)
tree7ec5527e205d5b62caaa862a7de8cd25199c8bf0 /t/app/controller/root.t
parent56f61b1441070aa0b9ddcfc74aca46c20313609f (diff)
parent92b253904062edd533e55c22824de6fd01e2f7c1 (diff)
Merge tag 'v2.6' into fiksgatami-dev
Diffstat (limited to 't/app/controller/root.t')
-rw-r--r--t/app/controller/root.t14
1 files changed, 14 insertions, 0 deletions
diff --git a/t/app/controller/root.t b/t/app/controller/root.t
index ddf659b77..85119da24 100644
--- a/t/app/controller/root.t
+++ b/t/app/controller/root.t
@@ -1,4 +1,5 @@
use FixMyStreet::TestMech;
+use Test::MockModule;
ok( my $mech = FixMyStreet::TestMech->new, 'Created mech object' );
@@ -73,4 +74,17 @@ FixMyStreet::override_config {
};
};
+subtest "check_login_disallowed cobrand hook" => sub {
+ my $cobrand = Test::MockModule->new('FixMyStreet::Cobrand::Default');
+ $cobrand->mock('check_login_disallowed', sub {
+ my $self = shift;
+ return 0 if $self->{c}->req->path eq 'auth';
+ return 1;
+ }
+ );
+
+ $mech->get_ok('/');
+ is $mech->uri->path_query, '/auth?r=', 'redirects to auth page';
+};
+
done_testing();