]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/browse_controller_test.rb
Adding first cut of Redactions support
[rails.git] / test / functional / browse_controller_test.rb
index 525c879f1118923d36753a20ff43c5f19e99563d..04b690ebf0119e3eb4816f51410503518e4d934c 100644 (file)
@@ -4,8 +4,45 @@ require 'browse_controller'
 class BrowseControllerTest < ActionController::TestCase
   api_fixtures
 
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/browse/start", :method => :get },
+      { :controller => "browse", :action => "start" }
+    )
+    assert_routing(
+      { :path => "/browse/node/1", :method => :get },
+      { :controller => "browse", :action => "node", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/node/1/history", :method => :get },
+      { :controller => "browse", :action => "node_history", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/way/1", :method => :get },
+      { :controller => "browse", :action => "way", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/way/1/history", :method => :get },
+      { :controller => "browse", :action => "way_history", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/relation/1", :method => :get },
+      { :controller => "browse", :action => "relation", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/relation/1/history", :method => :get },
+      { :controller => "browse", :action => "relation_history", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/browse/changeset/1", :method => :get },
+      { :controller => "browse", :action => "changeset", :id => "1" }
+    )
+  end
+
   def test_start
-    get :start
+    xhr :get, :start
     assert_response :success
   end