]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/api_controller_test.rb
Refactor deletion tests in way_controller_test to use factories.
[rails.git] / test / controllers / api_controller_test.rb
index 1ad53145ab4274f287c45803af7a2ee73bb49e66..7d249acf333a24dc70404de41719cb81d541a9d9 100644 (file)
@@ -69,7 +69,7 @@ class ApiControllerTest < ActionController::TestCase
     assert_response :success, "Expected scucess with the map call"
     assert_select "osm[version='#{API_VERSION}'][generator='#{GENERATOR}']", :count => 1 do
       assert_select "bounds[minlon='#{minlon}'][minlat='#{minlat}'][maxlon='#{maxlon}'][maxlat='#{maxlat}']", :count => 1
-      assert_select "node[id='#{node.id}'][lat='#{node.lat}'][lon='#{node.lon}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do
+      assert_select "node[id='#{node.id}'][lat='#{format('%.7f', node.lat)}'][lon='#{format('%.7f', 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
@@ -91,7 +91,7 @@ class ApiControllerTest < ActionController::TestCase
     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[id='#{node.id}'][lat='#{node.lat}'][lon='#{node.lon}'][version='#{node.version}'][changeset='#{node.changeset_id}'][visible='#{node.visible}'][timestamp='#{node.timestamp.xmlschema}']", :count => 1 do
+      assert_select "node[id='#{node.id}'][lat='#{format('%.7f', node.lat)}'][lon='#{format('%.7f', 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
@@ -364,6 +364,7 @@ class ApiControllerTest < ActionController::TestCase
       assert_select "api", :count => 1 do
         assert_select "version[minimum='#{API_VERSION}'][maximum='#{API_VERSION}']", :count => 1
         assert_select "area[maximum='#{MAX_REQUEST_AREA}']", :count => 1
+        assert_select "note_area[maximum='#{MAX_NOTE_REQUEST_AREA}']", :count => 1
         assert_select "tracepoints[per_page='#{TRACEPOINTS_PER_PAGE}']", :count => 1
         assert_select "changesets[maximum_elements='#{Changeset::MAX_ELEMENTS}']", :count => 1
         assert_select "status[database='online']", :count => 1