]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/old_way_controller_test.rb
Allow POST requests to the home page so OpenSearch works
[rails.git] / test / functional / old_way_controller_test.rb
index 31da1d2c784bb18d6598cbc52a486b77760343d7..f0ab6bd859409fc0fb3452dd8af335a25bebea60 100644 (file)
@@ -4,19 +4,32 @@ require 'old_way_controller'
 class OldWayControllerTest < ActionController::TestCase
   api_fixtures
 
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/api/0.6/way/1/history", :method => :get },
+      { :controller => "old_way", :action => "history", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/api/0.6/way/1/2", :method => :get },
+      { :controller => "old_way", :action => "version", :id => "1", :version => "2" }
+    )
+  end
+
   # -------------------------------------
   # Test reading old ways.
   # -------------------------------------
 
   def test_history_visible
     # check that a visible way is returned properly
-    get :history, :id => ways(:visible_way).id
+    get :history, :id => ways(:visible_way).way_id
     assert_response :success
   end
   
   def test_history_invisible
     # check that an invisible way's history is returned properly
-    get :history, :id => ways(:invisible_way).id
+    get :history, :id => ways(:invisible_way).way_id
     assert_response :success
   end