]> git.openstreetmap.org Git - rails.git/blobdiff - test/functional/oauth_clients_controller_test.rb
Add routing tests for all supported routes
[rails.git] / test / functional / oauth_clients_controller_test.rb
diff --git a/test/functional/oauth_clients_controller_test.rb b/test/functional/oauth_clients_controller_test.rb
new file mode 100644 (file)
index 0000000..64a1e4e
--- /dev/null
@@ -0,0 +1,36 @@
+require File.dirname(__FILE__) + '/../test_helper'
+
+class OauthClientsControllerTest < ActionController::TestCase
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/user/username/oauth_clients", :method => :get },
+      { :controller => "oauth_clients", :action => "index", :display_name => "username" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients/new", :method => :get },
+      { :controller => "oauth_clients", :action => "new", :display_name => "username" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients", :method => :post },
+      { :controller => "oauth_clients", :action => "create", :display_name => "username" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients/1", :method => :get },
+      { :controller => "oauth_clients", :action => "show", :display_name => "username", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients/1/edit", :method => :get },
+      { :controller => "oauth_clients", :action => "edit", :display_name => "username", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients/1", :method => :put },
+      { :controller => "oauth_clients", :action => "update", :display_name => "username", :id => "1" }
+    )
+    assert_routing(
+      { :path => "/user/username/oauth_clients/1", :method => :delete },
+      { :controller => "oauth_clients", :action => "destroy", :display_name => "username", :id => "1" }
+    )
+  end
+end