##// END OF EJS Templates
test: route: simplify "my" tests...
Toshi MARUYAMA -
r8246:27dee8eff450
parent child
Show More
@@ -1,71 +1,67
1 # Redmine - project management software
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
3 #
4 # This program is free software; you can redistribute it and/or
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
7 # of the License, or (at your option) any later version.
8 #
8 #
9 # This program is distributed in the hope that it will be useful,
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
12 # GNU General Public License for more details.
13 #
13 #
14 # You should have received a copy of the GNU General Public License
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
17
18 require File.expand_path('../../../test_helper', __FILE__)
18 require File.expand_path('../../../test_helper', __FILE__)
19
19
20 class RoutingMyTest < ActionController::IntegrationTest
20 class RoutingMyTest < ActionController::IntegrationTest
21 def test_my
21 def test_my
22 assert_routing(
22 ["get", "post"].each do |method|
23 { :method => 'get', :path => "/my/account" },
23 assert_routing(
24 { :controller => 'my', :action => 'account' }
24 { :method => method, :path => "/my/account" },
25 )
25 { :controller => 'my', :action => 'account' }
26 assert_routing(
26 )
27 { :method => 'post', :path => "/my/account" },
27 end
28 { :controller => 'my', :action => 'account' }
29 )
30 assert_routing(
28 assert_routing(
31 { :method => 'get', :path => "/my/page" },
29 { :method => 'get', :path => "/my/page" },
32 { :controller => 'my', :action => 'page' }
30 { :controller => 'my', :action => 'page' }
33 )
31 )
34 assert_routing(
32 assert_routing(
35 { :method => 'get', :path => "/my" },
33 { :method => 'get', :path => "/my" },
36 { :controller => 'my', :action => 'index' }
34 { :controller => 'my', :action => 'index' }
37 )
35 )
38 assert_routing(
36 assert_routing(
39 { :method => 'post', :path => "/my/reset_rss_key" },
37 { :method => 'post', :path => "/my/reset_rss_key" },
40 { :controller => 'my', :action => 'reset_rss_key' }
38 { :controller => 'my', :action => 'reset_rss_key' }
41 )
39 )
42 assert_routing(
40 assert_routing(
43 { :method => 'post', :path => "/my/reset_api_key" },
41 { :method => 'post', :path => "/my/reset_api_key" },
44 { :controller => 'my', :action => 'reset_api_key' }
42 { :controller => 'my', :action => 'reset_api_key' }
45 )
43 )
46 assert_routing(
44 ["get", "post"].each do |method|
47 { :method => 'get', :path => "/my/password" },
45 assert_routing(
48 { :controller => 'my', :action => 'password' }
46 { :method => method, :path => "/my/password" },
49 )
47 { :controller => 'my', :action => 'password' }
50 assert_routing(
48 )
51 { :method => 'post', :path => "/my/password" },
49 end
52 { :controller => 'my', :action => 'password' }
53 )
54 assert_routing(
50 assert_routing(
55 { :method => 'get', :path => "/my/page_layout" },
51 { :method => 'get', :path => "/my/page_layout" },
56 { :controller => 'my', :action => 'page_layout' }
52 { :controller => 'my', :action => 'page_layout' }
57 )
53 )
58 assert_routing(
54 assert_routing(
59 { :method => 'post', :path => "/my/add_block" },
55 { :method => 'post', :path => "/my/add_block" },
60 { :controller => 'my', :action => 'add_block' }
56 { :controller => 'my', :action => 'add_block' }
61 )
57 )
62 assert_routing(
58 assert_routing(
63 { :method => 'post', :path => "/my/remove_block" },
59 { :method => 'post', :path => "/my/remove_block" },
64 { :controller => 'my', :action => 'remove_block' }
60 { :controller => 'my', :action => 'remove_block' }
65 )
61 )
66 assert_routing(
62 assert_routing(
67 { :method => 'post', :path => "/my/order_blocks" },
63 { :method => 'post', :path => "/my/order_blocks" },
68 { :controller => 'my', :action => 'order_blocks' }
64 { :controller => 'my', :action => 'order_blocks' }
69 )
65 )
70 end
66 end
71 end
67 end
General Comments 0
You need to be logged in to leave comments. Login now