- def test_identify_fall_through_no_geonames
- post :search, query: 'foo bar baz'
- assert_response :success
- assert_equal ['osm_nominatim'], assigns(:sources)
+ ##
+ # Test identification of lat/lon pairs using S/W with degrees/mins
+ def test_identify_latlon_sw_dm
+ [
+ 'S 50° 04.064 W 014° 22.645',
+ "S 50° 04.064' W 014° 22.645",
+ "S 50° 04.064', W 014° 22.645'",
+ 'S50° 04.064 W14° 22.645',
+ 'S 50 04.064 W 014 22.645',
+ 'S50 4.064 W14 22.645',
+ "50° 04.064' S, 014° 22.645' W"
+ ].each do |code|
+ post :search, :query => code
+ assert_response :success
+ assert_equal ['osm_nominatim_reverse', 'geonames_reverse'], assigns(:sources)
+ assert_nil @controller.params[:query]
+ assert_in_delta -50.06773, @controller.params[:lat]
+ assert_in_delta -14.37742, @controller.params[:lon]
+ end