]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/way_controller_test.rb
added tests for way and relation controllers
[rails.git] / test / functional / way_controller_test.rb
index afe9e86528c24a110128469661129143f0f1f7ba..933dfb542edc9be778923735378a9052439b0de0 100644 (file)
@@ -37,6 +37,18 @@ class WayControllerTest < Test::Unit::TestCase
     # check chat a non-existent way is not returned
     get :read, :id => 0
     assert_response :not_found
+
+    # check the "ways for node" mode
+    get :ways_for_node, :id => current_nodes(:used_node_1).id
+    assert_response :success
+    # FIXME check whether this contains the stuff we want!
+    print @response.body
+
+    # check the "full" mode
+    get :full, :id => current_ways(:visible_way).id
+    assert_response :success
+    # FIXME check whether this contains the stuff we want!
+    print @response.body
   end
 
   # -------------------------------------
@@ -49,7 +61,7 @@ class WayControllerTest < Test::Unit::TestCase
     basic_authorization "test@openstreetmap.org", "test"
 
     # create a way with pre-existing nodes
-    content "<osm><way><nd id='#{nid1}'/><nd id='#{nid2}'/><tag k='test' v='yes' /></way></osm>"
+    content "<osm><way><nd ref='#{nid1}'/><nd ref='#{nid2}'/><tag k='test' v='yes' /></way></osm>"
     put :create
     # hope for success
     assert_response :success, 
@@ -80,7 +92,7 @@ class WayControllerTest < Test::Unit::TestCase
     basic_authorization "test@openstreetmap.org", "test"
 
     # create a way with non-existing node
-    content "<osm><way><nd id='0'/><tag k='test' v='yes' /></way></osm>"
+    content "<osm><way><nd ref='0'/><tag k='test' v='yes' /></way></osm>"
     put :create
     # expect failure
     assert_response :precondition_failed,