]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/api/nodes_controller_test.rb
Move the format tests to test the output from the controller
[rails.git] / test / controllers / api / nodes_controller_test.rb
index 6d990a84c6b25a5954983242381966acf8854e00..26a51d63b16f37f9674b4ed3dc6b6dae2b85141f 100644 (file)
@@ -147,6 +147,15 @@ module Api
       assert_response :not_found
     end
 
+    # Ensure the lat/lon is formatted as a decimal e.g. not 4.0e-05
+    def test_lat_lon_xml_format
+      node = create(:node, :latitude => (0.00004 * OldNode::SCALE).to_i, :longitude => (0.00008 * OldNode::SCALE).to_i)
+
+      get :show, :params => { :id => node.id }
+      assert_match(/lat="0.0000400"/, response.body)
+      assert_match(/lon="0.0000800"/, response.body)
+    end
+
     # this tests deletion restrictions - basic deletion is tested in the unit
     # tests for node!
     def test_delete