]> git.openstreetmap.org Git - rails.git/blob - test/controllers/oauth_controller_test.rb
Merge remote-tracking branch 'openstreetmap/pull/1336'
[rails.git] / test / controllers / oauth_controller_test.rb
1 require "test_helper"
2
3 class OauthControllerTest < ActionController::TestCase
4   ##
5   # test all routes which lead to this controller
6   def test_routes
7     assert_routing(
8       { :path => "/oauth/revoke", :method => :get },
9       { :controller => "oauth", :action => "revoke" }
10     )
11     assert_routing(
12       { :path => "/oauth/revoke", :method => :post },
13       { :controller => "oauth", :action => "revoke" }
14     )
15     assert_routing(
16       { :path => "/oauth/authorize", :method => :get },
17       { :controller => "oauth", :action => "authorize" }
18     )
19     assert_routing(
20       { :path => "/oauth/authorize", :method => :post },
21       { :controller => "oauth", :action => "authorize" }
22     )
23     assert_routing(
24       { :path => "/oauth/token", :method => :get },
25       { :controller => "oauth", :action => "token" }
26     )
27     assert_routing(
28       { :path => "/oauth/request_token", :method => :get },
29       { :controller => "oauth", :action => "request_token" }
30     )
31     assert_routing(
32       { :path => "/oauth/request_token", :method => :post },
33       { :controller => "oauth", :action => "request_token" }
34     )
35     assert_routing(
36       { :path => "/oauth/access_token", :method => :get },
37       { :controller => "oauth", :action => "access_token" }
38     )
39     assert_routing(
40       { :path => "/oauth/access_token", :method => :post },
41       { :controller => "oauth", :action => "access_token" }
42     )
43     assert_routing(
44       { :path => "/oauth/test_request", :method => :get },
45       { :controller => "oauth", :action => "test_request" }
46     )
47   end
48 end