diff options
author | Matthew Somerville <matthew@mysociety.org> | 2010-12-22 16:38:37 +0000 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2010-12-22 16:38:37 +0000 |
commit | a1f9b9d2422f4b14f79ed40fbd70f18510dfedf2 (patch) | |
tree | c675a4d916d684fde8085fda4c3a53ceb75b7166 /t/Page.t | |
parent | 74a45e725dc529af5dc8a677153f65588d6f8a2a (diff) | |
parent | 7acf747fe181d2e63499e80f235dc1a4ecd5098e (diff) |
Merge branch 'master' into cities_release_1
Diffstat (limited to 't/Page.t')
-rwxr-xr-x | t/Page.t | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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"); } |