X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/2d3972249c18fc5cd193a8b2f2efe9b46badb217..978ba726d95aa7f739c19be682259879ef8c2584:/test/controllers/api/map_controller_test.rb diff --git a/test/controllers/api/map_controller_test.rb b/test/controllers/api/map_controller_test.rb index dd7bb2cb3..e9459b6a2 100644 --- a/test/controllers/api/map_controller_test.rb +++ b/test/controllers/api/map_controller_test.rb @@ -131,8 +131,17 @@ module Api end assert_response :success, "Expected scucess with the map call" assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do - assert_select "bounds[minlon='#{format('%.7f', :lon => minlon)}'][minlat='#{format('%.7f', :lat => minlat)}'][maxlon='#{format('%.7f', :lon => maxlon)}'][maxlat='#{format('%.7f', :lat => maxlat)}']", :count => 1 - assert_select "node[id='#{node.id}'][lat='#{format('%.7f', :lat => node.lat)}'][lon='#{format('%.7f', :lon => node.lon)}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do + assert_select "bounds[minlon='#{format('%.7f', :lon => minlon)}']" \ + "[minlat='#{format('%.7f', :lat => minlat)}']" \ + "[maxlon='#{format('%.7f', :lon => maxlon)}']" \ + "[maxlat='#{format('%.7f', :lat => maxlat)}']", :count => 1 + assert_select "node[id='#{node.id}']" \ + "[lat='#{format('%.7f', :lat => node.lat)}']" \ + "[lon='#{format('%.7f', :lon => node.lon)}']" \ + "[version='#{node.version}']" \ + "[changeset='#{node.changeset_id}']" \ + "[visible='#{node.visible}']" \ + "[timestamp='#{node.timestamp.xmlschema}']", :count => 1 do # This should really be more generic assert_select "tag[k='#{tag.k}'][v='#{tag.v}']" end @@ -181,7 +190,7 @@ module Api .select { |a| a["version"] == node.version } .select { |a| a["changeset"] == node.changeset_id } .select { |a| a["timestamp"] == node.timestamp.xmlschema } - assert_equal result_nodes.count, 1 + assert_equal(1, result_nodes.count) result_node = result_nodes.first assert_equal result_node["tags"], tag.k => tag.v @@ -205,8 +214,17 @@ module Api get map_path(:bbox => bbox) assert_response :success, "The map call should have succeeded" assert_select "osm[version='#{Settings.api_version}'][generator='#{Settings.generator}']", :count => 1 do - assert_select "bounds[minlon='#{node.lon}'][minlat='#{node.lat}'][maxlon='#{node.lon}'][maxlat='#{node.lat}']", :count => 1 - assert_select "node[id='#{node.id}'][lat='#{format('%.7f', :lat => node.lat)}'][lon='#{format('%.7f', :lon => node.lon)}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do + assert_select "bounds[minlon='#{node.lon}']" \ + "[minlat='#{node.lat}']" \ + "[maxlon='#{node.lon}']" \ + "[maxlat='#{node.lat}']", :count => 1 + assert_select "node[id='#{node.id}']" \ + "[lat='#{format('%.7f', :lat => node.lat)}']" \ + "[lon='#{format('%.7f', :lon => node.lon)}']" \ + "[version='#{node.version}']" \ + "[changeset='#{node.changeset_id}']" \ + "[visible='#{node.visible}']" \ + "[timestamp='#{node.timestamp.xmlschema}']", :count => 1 do # This should really be more generic assert_select "tag[k='#{tag.k}'][v='#{tag.v}']" end