]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/old_node_controller_test.rb
Add routing tests for all supported routes
[rails.git] / test / functional / old_node_controller_test.rb
index 69ea0f345720a6e1d821c7bde8f5894c21d9e3fc..3c0358c2b9a7465704c953390ea017d9e1aba0d2 100644 (file)
@@ -8,6 +8,19 @@ class OldNodeControllerTest < ActionController::TestCase
   # TODO: test history
   #
 
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/api/0.6/node/1/history", :method => :get },
+      { :controller => "old_node", :action => "history", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/api/0.6/node/1/2", :method => :get },
+      { :controller => "old_node", :action => "version", :id => "1", :version => "2" }
+    )
+  end
+
   ##
   # test the version call by submitting several revisions of a new node
   # to the API and ensuring that later calls to version return the