]> git.openstreetmap.org Git - rails.git/blobdiff - test/controllers/oauth_controller_test.rb
Reorganise tests to match modern rails test layout
[rails.git] / test / controllers / oauth_controller_test.rb
diff --git a/test/controllers/oauth_controller_test.rb b/test/controllers/oauth_controller_test.rb
new file mode 100644 (file)
index 0000000..879e259
--- /dev/null
@@ -0,0 +1,48 @@
+require 'test_helper'
+
+class OauthControllerTest < ActionController::TestCase
+  ##
+  # test all routes which lead to this controller
+  def test_routes
+    assert_routing(
+      { :path => "/oauth/revoke", :method => :get },
+      { :controller => "oauth", :action => "revoke" }
+    )
+    assert_routing(
+      { :path => "/oauth/revoke", :method => :post },
+      { :controller => "oauth", :action => "revoke" }
+    )
+    assert_routing(
+      { :path => "/oauth/authorize", :method => :get },
+      { :controller => "oauth", :action => "authorize" }
+    )
+    assert_routing(
+      { :path => "/oauth/authorize", :method => :post },
+      { :controller => "oauth", :action => "authorize" }
+    )
+    assert_routing(
+      { :path => "/oauth/token", :method => :get },
+      { :controller => "oauth", :action => "token" }
+    )
+    assert_routing(
+      { :path => "/oauth/request_token", :method => :get },
+      { :controller => "oauth", :action => "request_token" }
+    )
+    assert_routing(
+      { :path => "/oauth/request_token", :method => :post },
+      { :controller => "oauth", :action => "request_token" }
+    )
+    assert_routing(
+      { :path => "/oauth/access_token", :method => :get },
+      { :controller => "oauth", :action => "access_token" }
+    )
+    assert_routing(
+      { :path => "/oauth/access_token", :method => :post },
+      { :controller => "oauth", :action => "access_token" }
+    )
+    assert_routing(
+      { :path => "/oauth/test_request", :method => :get },
+      { :controller => "oauth", :action => "test_request" }
+    )
+  end
+end