- ##
- # Test the UK postcode search
- def test_search_uk_postcode
- with_http_stubs "npemap" do
- xhr :get, :search_uk_postcode,
- :query => "CV4 7AL", :zoom => 10,
- :minlon => -0.559, :minlat => 51.217,
- :maxlon => 0.836, :maxlat => 51.766
- results_check :name => "CV4 7AL", :lat => 52.381748701968, :lon => -1.56176420939232
-
- xhr :get, :search_uk_postcode,
- :query => "XX9 9XX", :zoom => 10,
- :minlon => -0.559, :minlat => 51.217,
- :maxlon => 0.836, :maxlat => 51.766
- results_check
- end
+ get geocoder_search_latlon_path(:lat => -91.23, :lon => 4.56, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check :name => "4.56, -91.23", :lat => 4.56, :lon => -91.23, :zoom => 16
+
+ get geocoder_search_latlon_path(:lat => -1.23, :lon => 170.23, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check :name => "-1.23, 170.23", :lat => -1.23, :lon => 170.23, :zoom => 16
+
+ get geocoder_search_latlon_path(:lat => 91.23, :lon => 94.56, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check_error "Latitude or longitude are out of range"
+
+ get geocoder_search_latlon_path(:lat => -91.23, :lon => -94.56, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check_error "Latitude or longitude are out of range"
+
+ get geocoder_search_latlon_path(:lat => 1.23, :lon => -180.23, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check_error "Latitude or longitude are out of range"
+
+ get geocoder_search_latlon_path(:lat => 1.23, :lon => 180.23, :zoom => 16, :latlon_digits => true), :xhr => true
+ results_check_error "Latitude or longitude are out of range"