aboutsummaryrefslogtreecommitdiffstats
path: root/t/app
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-05-13 10:49:26 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-05-13 10:49:26 +0100
commit4e23c3aa7da5782be66295ac123bd63355d45a51 (patch)
treeda8c92c0b37939d87b26c61a0969df8045f7bb17 /t/app
parent2dd5facb9272bd16025b182386c4026858880334 (diff)
Use mocked Nominatim to deal with bad connections.
Diffstat (limited to 't/app')
-rw-r--r--t/app/controller/alert.t10
1 files changed, 8 insertions, 2 deletions
diff --git a/t/app/controller/alert.t b/t/app/controller/alert.t
index 9189f5e97..5bf2af428 100644
--- a/t/app/controller/alert.t
+++ b/t/app/controller/alert.t
@@ -1,10 +1,13 @@
use strict;
use warnings;
use Test::More;
+use LWP::Protocol::PSGI;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
+use t::Nominatim;
+
# check that we can get the page
$mech->get_ok('/alert');
$mech->title_like(qr/^Local RSS feeds and email alerts/);
@@ -38,8 +41,11 @@ FixMyStreet::override_config {
$mech->content_contains('council:2651:City_of_Edinburgh');
$mech->content_contains('ward:2651:20728:City_of_Edinburgh:City_Centre');
- $mech->get_ok('/alert/list?pc=High Street');
- $mech->content_contains('We found more than one match for that location');
+ subtest "Test Nominatim lookup" => sub {
+ LWP::Protocol::PSGI->register(t::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');
+ };
$mech->get_ok('/alert/list?pc=');
$mech->content_contains('To find out what local alerts we have for you');