diff options
Diffstat (limited to 'bin/test-run')
-rwxr-xr-x | bin/test-run | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/bin/test-run b/bin/test-run index 69e29f4f1..85ce87797 100755 --- a/bin/test-run +++ b/bin/test-run @@ -34,6 +34,7 @@ use File::Find; use lib "$FindBin::Bin/../perllib"; use Cobrand; use FixMyStreet::Geocode; +use Utils; my @actions = ('report', 'update', 'questionnaire', 'alert', 'static', 'cobrand', 'unit', 'eha_alert', 'import', 'rss'); my %actions_desc = ( @@ -216,10 +217,10 @@ sub submit_report { my ($postcode, $x, $y, $easting, $northing, $user_num, $council, $texts, $cobrand ) = @_; my @messages = @{$texts}; - # convert easting, northing to lat lon - my ( $latitude, $longitude ) = - mySociety::GeoUtil::national_grid_to_wgs84( $easting, $northing, 'G' ); - + # convert easting, northing to lat lon + ( $latitude, $longitude ) = + Utils::convert_en_to_latlon( $easting, $northing ); + submit_postcode($cobrand, $postcode, $messages[0]); { # Writing values to hidden fields, so switching @@ -392,7 +393,9 @@ sub do_alert { my $n = 673533; # get the lat,lon from the postcode so that it matches - my ( $lat, $lon ) = FixMyStreet::Geocode::lookup( $postcode, undef ); + my ( $lat, $lon ) = + map { Utils::truncate_coordinate($_) } + FixMyStreet::Geocode::lookup( $postcode, undef ); my $messages = english_fms_messages(); submit_postcode('', $postcode, 'Problems in this area'); @@ -436,7 +439,9 @@ sub do_eha_alert { my $y = 4175; my $n = 673533; # get the lat,lon from the postcode so that it matches - my ( $lat, $lon ) = FixMyStreet::Geocode::lookup( $postcode, undef ); + my ( $lat, $lon ) = + map { Utils::truncate_coordinate($_) } + FixMyStreet::Geocode::lookup( $postcode, undef ); my @texts = ('Eiddo gwag yn yr ardal hon', 'Adrodd am eiddo gwag', @@ -536,9 +541,9 @@ sub do_rss { my %redirects = ( # should always go to lat lon - '/rss/n/406886,289126' => '/rss/l/52.4999935999706,-1.89999324167977', - '/rss/2524/1779' => '/rss/l/52.4802940052892,-1.89693098994692', - '/rss/pc/SW1A1AA' => '/rss/l/51.5010096115539,-0.141587067110009', + '/rss/n/406886,289126' => '/rss/l/52.499993,-1.899993', + '/rss/2524/1779' => '/rss/l/52.480294,-1.896931', + '/rss/pc/SW1A1AA' => '/rss/l/51.501010,-0.141587', '/rss/l/52.5/-1.9' => '/rss/l/52.5/-1.9', # go to reports |