X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/783b5e3729228908d7404ae7404af1023501a906..6a77bbe544b9866844473230b0c2406062ab9b5b:/test/test_helper.rb diff --git a/test/test_helper.rb b/test/test_helper.rb index e66d782ff..e4db27d31 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -170,5 +170,31 @@ module ActiveSupport fill_in "password", :with => "test" click_on "Login", :match => :first end + + def xml_for_node(node) + doc = OSM::API.new.get_xml_doc + doc.root << xml_node_for_node(node) + doc + end + + def xml_node_for_node(node) + el = XML::Node.new "node" + el["id"] = node.id.to_s + + OMHelper.add_metadata_to_xml_node(el, node, {}, {}) + + if node.visible? + el["lat"] = node.lat.to_s + el["lon"] = node.lon.to_s + end + + OMHelper.add_tags_to_xml_node(el, node.node_tags) + + el + end + + class OMHelper + extend ObjectMetadata + end end end