def test_identify_latlon_basic
[
"50.06773 14.37742",
+ "50.06773/14.37742",
"50.06773, 14.37742",
"+50.06773 +14.37742",
- "+50.06773, +14.37742"
+ "+50.06773, +14.37742",
+ "+50.06773/+14.37742"
].each do |code|
latlon_check code, 50.06773, 14.37742
end
assert_response :success
assert_template :search
assert_template :layout => "map"
- assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources)
+ assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name)
assert_nil @controller.params[:query]
assert_in_delta lat, @controller.params[:lat]
assert_in_delta lon, @controller.params[:lon]
assert_response :success
assert_template :search
assert_template :layout => "xhr"
- assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources)
+ assert_equal %w[latlon osm_nominatim_reverse], assigns(:sources).pluck(:name)
assert_nil @controller.params[:query]
assert_in_delta lat, @controller.params[:lat]
assert_in_delta lon, @controller.params[:lon]
assert_response :success
assert_template :search
assert_template :layout => "map"
- assert_equal sources, assigns(:sources)
+ assert_equal sources, assigns(:sources).pluck(:name)
get search_path(:query => query), :xhr => true
assert_response :success
assert_template :search
assert_template :layout => "xhr"
- assert_equal sources, assigns(:sources)
+ assert_equal sources, assigns(:sources).pluck(:name)
end
def results_check(*results)
assert_response :success
assert_template :error
assert_template :layout => nil
- assert_select "p.search_results_error", error
+ assert_select ".alert.alert-danger", error
end
end