##// END OF EJS Templates
test: route: move projects test to new file...
Toshi MARUYAMA -
r8240:0bfdf7d5b759
parent child
Show More
@@ -0,0 +1,91
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
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
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.expand_path('../../../test_helper', __FILE__)
19
20 class RoutingProjectsTest < ActionController::IntegrationTest
21 def test_projects
22 assert_routing(
23 { :method => 'get', :path => "/projects" },
24 { :controller => 'projects', :action => 'index' }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/projects.atom" },
28 { :controller => 'projects', :action => 'index', :format => 'atom' }
29 )
30 assert_routing(
31 { :method => 'get', :path => "/projects.xml" },
32 { :controller => 'projects', :action => 'index', :format => 'xml' }
33 )
34 assert_routing(
35 { :method => 'get', :path => "/projects/new" },
36 { :controller => 'projects', :action => 'new' }
37 )
38 assert_routing(
39 { :method => 'get', :path => "/projects/test" },
40 { :controller => 'projects', :action => 'show', :id => 'test' }
41 )
42 assert_routing(
43 { :method => 'get', :path => "/projects/1.xml" },
44 { :controller => 'projects', :action => 'show', :id => '1',
45 :format => 'xml' }
46 )
47 assert_routing(
48 { :method => 'get', :path => "/projects/4223/settings" },
49 { :controller => 'projects', :action => 'settings', :id => '4223' }
50 )
51 assert_routing(
52 { :method => 'get', :path => "/projects/4223/settings/members" },
53 { :controller => 'projects', :action => 'settings', :id => '4223',
54 :tab => 'members' }
55 )
56 assert_routing(
57 { :method => 'post', :path => "/projects" },
58 { :controller => 'projects', :action => 'create' }
59 )
60 assert_routing(
61 { :method => 'post', :path => "/projects.xml" },
62 { :controller => 'projects', :action => 'create', :format => 'xml' }
63 )
64 assert_routing(
65 { :method => 'post', :path => "/projects/64/archive" },
66 { :controller => 'projects', :action => 'archive', :id => '64' }
67 )
68 assert_routing(
69 { :method => 'post', :path => "/projects/64/unarchive" },
70 { :controller => 'projects', :action => 'unarchive', :id => '64' }
71 )
72 assert_routing(
73 { :method => 'put', :path => "/projects/4223" },
74 { :controller => 'projects', :action => 'update', :id => '4223' }
75 )
76 assert_routing(
77 { :method => 'put', :path => "/projects/1.xml" },
78 { :controller => 'projects', :action => 'update', :id => '1',
79 :format => 'xml' }
80 )
81 assert_routing(
82 { :method => 'delete', :path => "/projects/64" },
83 { :controller => 'projects', :action => 'destroy', :id => '64' }
84 )
85 assert_routing(
86 { :method => 'delete', :path => "/projects/1.xml" },
87 { :controller => 'projects', :action => 'destroy', :id => '1',
88 :format => 'xml' }
89 )
90 end
91 end
@@ -18,77 +18,6
18 require File.expand_path('../../test_helper', __FILE__)
18 require File.expand_path('../../test_helper', __FILE__)
19
19
20 class RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 def test_projects
22 assert_routing(
23 { :method => 'get', :path => "/projects" },
24 { :controller => 'projects', :action => 'index' }
25 )
26 assert_routing(
27 { :method => 'get', :path => "/projects.atom" },
28 { :controller => 'projects', :action => 'index', :format => 'atom' }
29 )
30 assert_routing(
31 { :method => 'get', :path => "/projects.xml" },
32 { :controller => 'projects', :action => 'index', :format => 'xml' }
33 )
34 assert_routing(
35 { :method => 'get', :path => "/projects/new" },
36 { :controller => 'projects', :action => 'new' }
37 )
38 assert_routing(
39 { :method => 'get', :path => "/projects/test" },
40 { :controller => 'projects', :action => 'show', :id => 'test' }
41 )
42 assert_routing(
43 { :method => 'get', :path => "/projects/1.xml" },
44 { :controller => 'projects', :action => 'show', :id => '1',
45 :format => 'xml' }
46 )
47 assert_routing(
48 { :method => 'get', :path => "/projects/4223/settings" },
49 { :controller => 'projects', :action => 'settings', :id => '4223' }
50 )
51 assert_routing(
52 { :method => 'get', :path => "/projects/4223/settings/members" },
53 { :controller => 'projects', :action => 'settings', :id => '4223',
54 :tab => 'members' }
55 )
56 assert_routing(
57 { :method => 'post', :path => "/projects" },
58 { :controller => 'projects', :action => 'create' }
59 )
60 assert_routing(
61 { :method => 'post', :path => "/projects.xml" },
62 { :controller => 'projects', :action => 'create', :format => 'xml' }
63 )
64 assert_routing(
65 { :method => 'post', :path => "/projects/64/archive" },
66 { :controller => 'projects', :action => 'archive', :id => '64' }
67 )
68 assert_routing(
69 { :method => 'post', :path => "/projects/64/unarchive" },
70 { :controller => 'projects', :action => 'unarchive', :id => '64' }
71 )
72 assert_routing(
73 { :method => 'put', :path => "/projects/4223" },
74 { :controller => 'projects', :action => 'update', :id => '4223' }
75 )
76 assert_routing(
77 { :method => 'put', :path => "/projects/1.xml" },
78 { :controller => 'projects', :action => 'update', :id => '1',
79 :format => 'xml' }
80 )
81 assert_routing(
82 { :method => 'delete', :path => "/projects/64" },
83 { :controller => 'projects', :action => 'destroy', :id => '64' }
84 )
85 assert_routing(
86 { :method => 'delete', :path => "/projects/1.xml" },
87 { :controller => 'projects', :action => 'destroy', :id => '1',
88 :format => 'xml' }
89 )
90 end
91
92 def test_queries
21 def test_queries
93 assert_routing(
22 assert_routing(
94 { :method => 'get', :path => "/queries.xml" },
23 { :method => 'get', :path => "/queries.xml" },
General Comments 0
You need to be logged in to leave comments. Login now