aboutsummaryrefslogtreecommitdiffstats
path: root/t/app/controller
diff options
context:
space:
mode:
Diffstat (limited to 't/app/controller')
-rw-r--r--t/app/controller/alert.t3
-rw-r--r--t/app/controller/root.t15
2 files changed, 15 insertions, 3 deletions
diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t
index ce3c2ef9b..57e73e5ec 100644
--- a/t/app/controller/alert.t
+++ b/t/app/controller/alert.t
@@ -1,5 +1,3 @@
-use LWP::Protocol::PSGI;
-
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
@@ -39,7 +37,6 @@ FixMyStreet::override_config {
$mech->content_contains('ward:2651:20728:Edinburgh:City_Centre');
subtest "Test Nominatim lookup" => sub {
- LWP::Protocol::PSGI->register(t::Mock::Nominatim->run_if_script, host => 'nominatim.openstreetmap.org');
$mech->get_ok('/alert/list?pc=High Street');
$mech->content_contains('We found more than one match for that location');
};
diff --git a/t/app/controller/root.t b/t/app/controller/root.t
index ddf659b77..b5f8ba031 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,18 @@ FixMyStreet::override_config {
};
};
+subtest "check_login_disallowed cobrand hook" => sub {
+ warn '#' x 50 . "\n";
+ 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();