diff options
author | Struan Donald <struan@exo.org.uk> | 2011-06-13 15:41:31 +0100 |
---|---|---|
committer | Struan Donald <struan@exo.org.uk> | 2011-06-13 15:41:31 +0100 |
commit | bced721d43c196fa9ae845d4558c277ef271714b (patch) | |
tree | 45bf2393b377859147ce824554b73cc736524b0a | |
parent | 11ea462d5d9e542e9b395f1309a2e4378dbc24f0 (diff) | |
parent | 75c00e4a2ad9ceeed894a89032bb2d9b160caf10 (diff) |
Merge branch 'master' of ssh://git.mysociety.org/data/git/public/fixmystreet
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Around.pm | 1 | ||||
-rw-r--r-- | t/app/controller/around.t | 2 | ||||
-rw-r--r-- | t/app/controller/index.t | 4 |
3 files changed, 4 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Around.pm b/perllib/FixMyStreet/App/Controller/Around.pm index 82d920b3e..d90a46b32 100644 --- a/perllib/FixMyStreet/App/Controller/Around.pm +++ b/perllib/FixMyStreet/App/Controller/Around.pm @@ -90,6 +90,7 @@ sub redirect_en_or_xy_to_latlon : Private { if ( $x || $y ) { ( $lat, $lon ) = FixMyStreet::Map::tile_xy_to_wgs84( $x, $y ); + ( $lat, $lon ) = map { Utils::truncate_coordinate($_) } ( $lat, $lon ); } elsif ( $e || $n ) { ( $lat, $lon ) = Utils::convert_en_to_latlon_truncated( $e, $n ); diff --git a/t/app/controller/around.t b/t/app/controller/around.t index 33c959b48..ba0dfe1b4 100644 --- a/t/app/controller/around.t +++ b/t/app/controller/around.t @@ -19,7 +19,7 @@ subtest "redirect x,y requests to lat/lon (301 - permanent)" => sub { # did we redirect to lat,lon? is $mech->uri->path, '/around', "still on /around"; is_deeply { $mech->uri->query_form }, - { lat => 51.4998246332569, lon => -0.140137309739907, }, + { lat => 51.499825, lon => -0.140137, }, "lat,lon correctly set"; # was it a 301? diff --git a/t/app/controller/index.t b/t/app/controller/index.t index cebeaf676..be947e344 100644 --- a/t/app/controller/index.t +++ b/t/app/controller/index.t @@ -33,8 +33,8 @@ subtest "does pc, (x,y), (e,n) or (lat,lon) go to /around" => sub { out => { lat => 51.50100, lon => -0.14158 }, }, { - in => { x => 3281, y => 1113, }, - out => { lat => 51.4998246332569, lon => -0.140137309739907 }, + in => { x => 3281, y => 1113, }, + out => { lat => 51.499825, lon => -0.140137 }, }, { in => { e => 1234, n => 4567 }, |