aboutsummaryrefslogtreecommitdiffstats
path: root/t/Page.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Page.t')
-rwxr-xr-xt/Page.t13
1 files changed, 6 insertions, 7 deletions
diff --git a/t/Page.t b/t/Page.t
index 26962c743..d4ccc9f3d 100755
--- a/t/Page.t
+++ b/t/Page.t
@@ -11,7 +11,7 @@
use strict;
use warnings;
-use Test::More tests => 15;
+use Test::More tests => 13;
use Test::Exception;
use FindBin;
@@ -20,6 +20,7 @@ use lib "$FindBin::Bin/../perllib";
use lib "$FindBin::Bin/../commonlib/perllib";
use Page;
+use FixMyStreet::Geocode;
use mySociety::MockQuery;
use mySociety::Locale;
@@ -40,14 +41,12 @@ sub test_geocode_string() {
my $q = new MockQuery('nosite', \%params);
# geocode a straightforward string, expect success
- my ($x, $y, $easting, $northing, $error) = Page::geocode_string('Buckingham Palace', $q);
- ok($x == 3280, 'example x coordinate generated') or diag("Got $x");
- ok($y == 1114, 'example y coordinate generated') or diag("Got $y");;
- ok($easting == 529044, 'example easting generated') or diag("Got $easting");
- ok($northing == 179619, 'example northing generated') or diag("Got $northing");
+ my ($easting, $northing, $error) = FixMyStreet::Geocode::string('Buckingham Palace', $q);
+ ok($easting == 529068, 'example easting generated') or diag("Got $easting");
+ ok($northing == 179684, 'example northing generated') or diag("Got $northing");
ok(! defined($error), 'should not generate error for simple example') or diag("Got $error");
# expect a failure message for Northern Ireland
- ($x, $y, $easting, $northing, $error) = Page::geocode_string('Falls Road, Belfast', $q);
+ ($easting, $northing, $error) = FixMyStreet::Geocode::string('Falls Road, Belfast', $q);
ok($error eq "We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.", 'error message produced for NI location') or diag("Got $error");
}