aboutsummaryrefslogtreecommitdiffstats
path: root/t/cobrand/fixamingata.t
diff options
context:
space:
mode:
authorMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
committerMarius Halden <marius.h@lden.org>2017-05-28 21:31:42 +0200
commit987124b09a32248414faf4d0d6615d43b29ac6f6 (patch)
treea549db8af723c981d3b346e855f25d6fd5ff8aa7 /t/cobrand/fixamingata.t
parentdbf56159e44c1560a413022451bf1a1c4cb22a52 (diff)
parenta085b63ce09f87e83b75cda9b9cd08aadfe75d61 (diff)
Merge tag 'v2.0.4' into fiksgatami-dev
Diffstat (limited to 't/cobrand/fixamingata.t')
-rw-r--r--t/cobrand/fixamingata.t13
1 files changed, 6 insertions, 7 deletions
diff --git a/t/cobrand/fixamingata.t b/t/cobrand/fixamingata.t
index 2ef3c09b4..d6a1c2b34 100644
--- a/t/cobrand/fixamingata.t
+++ b/t/cobrand/fixamingata.t
@@ -1,19 +1,22 @@
use strict;
use warnings;
use Test::More;
-use LWP::Protocol::PSGI;
+use Test::MockModule;
BEGIN {
use FixMyStreet;
FixMyStreet->test_mode(1);
}
-use t::Mock::MapIt;
use mySociety::Locale;
use FixMyStreet::TestMech;
my $mech = FixMyStreet::TestMech->new;
+# Closest road reverse geocode mock
+my $resolver = Test::MockModule->new('LWP::Simple');
+$resolver->mock('get', sub($) { "<result></result>" });
+
# Front page test
ok $mech->host("www.fixamingata.se"), "change host to FixaMinGata";
@@ -101,13 +104,9 @@ subtest "Test ajax decimal points" => sub {
# requesting the page, so that the code performs a full switch to Swedish
mySociety::Locale::push('en-gb');
- # A note to the future - the run_if_script line must be within a subtest
- # otherwise it fails to work
- LWP::Protocol::PSGI->register(t::Mock::MapIt->run_if_script, host => 'mapit.sweden');
-
FixMyStreet::override_config {
ALLOWED_COBRANDS => [ 'fixamingata' ],
- MAPIT_URL => 'http://mapit.sweden/'
+ MAPIT_URL => 'http://mapit.uk/'
}, sub {
$mech->get_ok('/ajax/lookup_location?term=12345');
# We want an actual decimal point in a JSON response...