+ search_check 'foo bar baz', ['osm_nominatim']
+ end
+
+private
+ def latlon_check(query, lat, lon)
+ post :search, :query => query
+ assert_response :success
+ assert_template "search"
+ assert_template :layout => "map"
+ assert_equal ['latlon' ,'osm_nominatim_reverse', 'geonames_reverse'], assigns(:sources)
+ assert_nil @controller.params[:query]
+ assert_in_delta lat, @controller.params[:lat]
+ assert_in_delta lon, @controller.params[:lon]
+
+ xhr :post, :search, :query => query
+ assert_response :success
+ assert_template "search"
+ assert_template :layout => "xhr"
+ assert_equal ['latlon' ,'osm_nominatim_reverse', 'geonames_reverse'], assigns(:sources)
+ assert_nil @controller.params[:query]
+ assert_in_delta lat, @controller.params[:lat]
+ assert_in_delta lon, @controller.params[:lon]
+ end
+
+ def search_check(query, sources)
+ post :search, :query => query
+ assert_response :success
+ assert_template "search"
+ assert_template :layout => "map"
+ assert_equal sources, assigns(:sources)
+
+ xhr :post, :search, :query => query