+
+ def test_map_complete_way
+ node = current_nodes(:used_node_2)
+ bbox = "#{node.lon},#{node.lat},#{node.lon},#{node.lat}"
+ get :map, :bbox => bbox
+ assert_response :success, "The map call should have succeeded"
+ assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do
+ assert_select "bounds[minlon='#{node.lon}'][minlat='#{node.lat}'][maxlon='#{node.lon}'][maxlat='#{node.lat}']", :count => 1
+ assert_select "node", :count => 3
+ assert_select "node[id='4']", :count => 1
+ assert_select "node[id='11']", :count => 1
+ assert_select "node[id='15']", :count => 1
+ assert_select "way", :count => 2
+ assert_select "way[id='5']", :count => 1
+ assert_select "way[id='7']", :count => 1
+ assert_select "relation", :count => 1
+ assert_select "relation[id='8']", :count => 1
+ end
+ end
+
+ def test_map_empty
+ get :map, :bbox => "179.998,89.998,179.999.1,89.999"
+ assert_response :success, "The map call should have succeeded"
+ assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do
+ assert_select "bounds[minlon='179.998'][minlat='89.998'][maxlon='179.999'][maxlat='89.999']", :count => 1
+ assert_select "node", :count => 0
+ assert_select "way", :count => 0
+ assert_select "relation", :count => 0
+ end
+ end
+