diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/Cobrand.t | 14 | ||||
-rw-r--r-- | t/Cobrands/Mysite/Util.pm | 4 | ||||
-rwxr-xr-x | t/Page.t | 13 |
3 files changed, 7 insertions, 24 deletions
diff --git a/t/Cobrand.t b/t/Cobrand.t index 1f3321b0d..f6c2e9c87 100755 --- a/t/Cobrand.t +++ b/t/Cobrand.t @@ -11,7 +11,7 @@ use strict; use warnings; -use Test::More tests => 62; +use Test::More tests => 59; use Test::Exception; use Error qw(:try); @@ -213,17 +213,6 @@ sub test_url { is($url, '/xyz', 'url returns passed url if there is no url function defined by the cobrand'); } -sub test_show_watermark { - my $cobrand = 'mysite'; - my $watermark = Cobrand::show_watermark($cobrand); - is($watermark, 0, 'show_watermark returns output from cobrand module'); - - $cobrand = 'nosite'; - $watermark = Cobrand::show_watermark($cobrand); - is($watermark, 1, 'watermark returns 1 if there is no show_watermark function defined by the cobrand'); - -} - sub test_allow_photo_upload { my $cobrand = 'mysite'; my $photo_upload = Cobrand::allow_photo_upload($cobrand); @@ -287,7 +276,6 @@ ok(test_root_path_js() == 1, 'Ran all tests for root_js'); ok(test_site_title() == 1, 'Ran all tests for site_title'); ok(test_on_map_list_limit() == 1, 'Ran all tests for on_map_list_limit'); ok(test_url() == 1, 'Ran all tests for url'); -ok(test_show_watermark() == 1, 'Ran all tests for show_watermark'); ok(test_allow_photo_upload() == 1, 'Ran all tests for allow_photo_upload'); ok(test_allow_photo_display() == 1, 'Ran all tests for allow_photo_display'); ok(test_council_check() == 1, 'Ran all tests for council_check'); diff --git a/t/Cobrands/Mysite/Util.pm b/t/Cobrands/Mysite/Util.pm index 8aedd2c8c..c1a8023c1 100644 --- a/t/Cobrands/Mysite/Util.pm +++ b/t/Cobrands/Mysite/Util.pm @@ -87,10 +87,6 @@ sub url { return '/transformed_url'; } -sub show_watermark { - return 0; -} - sub allow_photo_upload { return 0; } @@ -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"); } |