]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/old_node_controller_test.rb
Pluralize nodes, ways and relations controllers
[rails.git] / test / controllers / old_node_controller_test.rb
index e08fbb65ec48cc5beb278ac7277d0801d0800b66..0d8db0589e30e27fc94cf174574e0e92bb6765da 100644 (file)
@@ -55,11 +55,11 @@ class OldNodeControllerTest < ActionController::TestCase
     versions[xml_node["version"]] = xml_doc.to_s
 
     # randomly move the node about
-    20.times do
+    3.times do
       # move the node somewhere else
       xml_node["lat"] = precision(rand * 180 - 90).to_s
       xml_node["lon"] = precision(rand * 360 - 180).to_s
-      with_controller(NodeController.new) do
+      with_controller(NodesController.new) do
         content xml_doc
         put :update, :params => { :id => nodeid }
         assert_response :forbidden, "Should have rejected node update"
@@ -70,12 +70,12 @@ class OldNodeControllerTest < ActionController::TestCase
     end
 
     # add a bunch of random tags
-    30.times do
+    3.times do
       xml_tag = XML::Node.new("tag")
       xml_tag["k"] = random_string
       xml_tag["v"] = random_string
       xml_node << xml_tag
-      with_controller(NodeController.new) do
+      with_controller(NodesController.new) do
         content xml_doc
         put :update, :params => { :id => nodeid }
         assert_response :forbidden,
@@ -105,11 +105,11 @@ class OldNodeControllerTest < ActionController::TestCase
     versions[xml_node["version"]] = xml_doc.to_s
 
     # randomly move the node about
-    20.times do
+    3.times do
       # move the node somewhere else
       xml_node["lat"] = precision(rand * 180 - 90).to_s
       xml_node["lon"] = precision(rand * 360 - 180).to_s
-      with_controller(NodeController.new) do
+      with_controller(NodesController.new) do
         content xml_doc
         put :update, :params => { :id => nodeid }
         assert_response :success
@@ -120,12 +120,12 @@ class OldNodeControllerTest < ActionController::TestCase
     end
 
     # add a bunch of random tags
-    30.times do
+    3.times do
       xml_tag = XML::Node.new("tag")
       xml_tag["k"] = random_string
       xml_tag["v"] = random_string
       xml_node << xml_tag
-      with_controller(NodeController.new) do
+      with_controller(NodesController.new) do
         content xml_doc
         put :update, :params => { :id => nodeid }
         assert_response :success,
@@ -161,7 +161,7 @@ class OldNodeControllerTest < ActionController::TestCase
     get :version, :params => { :id => id, :version => version }
     assert_response :not_found
   rescue ActionController::UrlGenerationError => ex
-    assert_match /No route matches/, ex.to_s
+    assert_match(/No route matches/, ex.to_s)
   end
 
   ##
@@ -390,7 +390,7 @@ class OldNodeControllerTest < ActionController::TestCase
 
   def check_current_version(node_id)
     # get the current version of the node
-    current_node = with_controller(NodeController.new) do
+    current_node = with_controller(NodesController.new) do
       get :read, :params => { :id => node_id }
       assert_response :success, "cant get current node #{node_id}"
       Node.from_xml(@response.body)