##// END OF EJS Templates
test: replace "should_route" of "issues" REST actions to "assert_routing" at integration/routing_test.rb...
Toshi MARUYAMA -
r8099:4d2a832fb663
parent child
Show More
@@ -1,551 +1,597
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 RoutingTest < ActionController::IntegrationTest
20 class RoutingTest < ActionController::IntegrationTest
21 def test_activities
21 def test_activities
22 assert_routing(
22 assert_routing(
23 { :method => 'get', :path => "/activity" },
23 { :method => 'get', :path => "/activity" },
24 { :controller => 'activities', :action => 'index', :id => nil }
24 { :controller => 'activities', :action => 'index', :id => nil }
25 )
25 )
26 assert_routing(
26 assert_routing(
27 { :method => 'get', :path => "/activity.atom" },
27 { :method => 'get', :path => "/activity.atom" },
28 { :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' }
28 { :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' }
29 )
29 )
30 end
30 end
31
31
32 def test_attachments
32 def test_attachments
33 assert_routing(
33 assert_routing(
34 { :method => 'get', :path => "/attachments/1" },
34 { :method => 'get', :path => "/attachments/1" },
35 { :controller => 'attachments', :action => 'show', :id => '1' }
35 { :controller => 'attachments', :action => 'show', :id => '1' }
36 )
36 )
37 assert_routing(
37 assert_routing(
38 { :method => 'get', :path => "/attachments/1.xml" },
38 { :method => 'get', :path => "/attachments/1.xml" },
39 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' }
39 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' }
40 )
40 )
41 assert_routing(
41 assert_routing(
42 { :method => 'get', :path => "/attachments/1.json" },
42 { :method => 'get', :path => "/attachments/1.json" },
43 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' }
43 { :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' }
44 )
44 )
45 assert_routing(
45 assert_routing(
46 { :method => 'get', :path => "/attachments/1/filename.ext" },
46 { :method => 'get', :path => "/attachments/1/filename.ext" },
47 { :controller => 'attachments', :action => 'show', :id => '1',
47 { :controller => 'attachments', :action => 'show', :id => '1',
48 :filename => 'filename.ext' }
48 :filename => 'filename.ext' }
49 )
49 )
50 assert_routing(
50 assert_routing(
51 { :method => 'get', :path => "/attachments/download/1" },
51 { :method => 'get', :path => "/attachments/download/1" },
52 { :controller => 'attachments', :action => 'download', :id => '1' }
52 { :controller => 'attachments', :action => 'download', :id => '1' }
53 )
53 )
54 assert_routing(
54 assert_routing(
55 { :method => 'get', :path => "/attachments/download/1/filename.ext" },
55 { :method => 'get', :path => "/attachments/download/1/filename.ext" },
56 { :controller => 'attachments', :action => 'download', :id => '1',
56 { :controller => 'attachments', :action => 'download', :id => '1',
57 :filename => 'filename.ext' }
57 :filename => 'filename.ext' }
58 )
58 )
59 end
59 end
60
60
61 def test_boards
61 def test_boards
62 assert_routing(
62 assert_routing(
63 { :method => 'get', :path => "/projects/world_domination/boards" },
63 { :method => 'get', :path => "/projects/world_domination/boards" },
64 { :controller => 'boards', :action => 'index', :project_id => 'world_domination' }
64 { :controller => 'boards', :action => 'index', :project_id => 'world_domination' }
65 )
65 )
66 assert_routing(
66 assert_routing(
67 { :method => 'get', :path => "/projects/world_domination/boards/new" },
67 { :method => 'get', :path => "/projects/world_domination/boards/new" },
68 { :controller => 'boards', :action => 'new', :project_id => 'world_domination' }
68 { :controller => 'boards', :action => 'new', :project_id => 'world_domination' }
69 )
69 )
70 assert_routing(
70 assert_routing(
71 { :method => 'get', :path => "/projects/world_domination/boards/44" },
71 { :method => 'get', :path => "/projects/world_domination/boards/44" },
72 { :controller => 'boards', :action => 'show', :project_id => 'world_domination',
72 { :controller => 'boards', :action => 'show', :project_id => 'world_domination',
73 :id => '44' }
73 :id => '44' }
74 )
74 )
75 assert_routing(
75 assert_routing(
76 { :method => 'get', :path => "/projects/world_domination/boards/44.atom" },
76 { :method => 'get', :path => "/projects/world_domination/boards/44.atom" },
77 { :controller => 'boards', :action => 'show', :project_id => 'world_domination',
77 { :controller => 'boards', :action => 'show', :project_id => 'world_domination',
78 :id => '44', :format => 'atom' }
78 :id => '44', :format => 'atom' }
79 )
79 )
80 assert_routing(
80 assert_routing(
81 { :method => 'get', :path => "/projects/world_domination/boards/44/edit" },
81 { :method => 'get', :path => "/projects/world_domination/boards/44/edit" },
82 { :controller => 'boards', :action => 'edit', :project_id => 'world_domination',
82 { :controller => 'boards', :action => 'edit', :project_id => 'world_domination',
83 :id => '44' }
83 :id => '44' }
84 )
84 )
85 assert_routing(
85 assert_routing(
86 { :method => 'post', :path => "/projects/world_domination/boards" },
86 { :method => 'post', :path => "/projects/world_domination/boards" },
87 { :controller => 'boards', :action => 'create', :project_id => 'world_domination' }
87 { :controller => 'boards', :action => 'create', :project_id => 'world_domination' }
88 )
88 )
89 assert_routing(
89 assert_routing(
90 { :method => 'put', :path => "/projects/world_domination/boards/44" },
90 { :method => 'put', :path => "/projects/world_domination/boards/44" },
91 { :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' }
91 { :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' }
92 )
92 )
93 assert_routing(
93 assert_routing(
94 { :method => 'delete', :path => "/projects/world_domination/boards/44" },
94 { :method => 'delete', :path => "/projects/world_domination/boards/44" },
95 { :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' }
95 { :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' }
96 )
96 )
97 end
97 end
98
98
99 def test_custom_fields
99 def test_custom_fields
100 assert_routing(
100 assert_routing(
101 { :method => 'get', :path => "/custom_fields" },
101 { :method => 'get', :path => "/custom_fields" },
102 { :controller => 'custom_fields', :action => 'index' }
102 { :controller => 'custom_fields', :action => 'index' }
103 )
103 )
104 assert_routing(
104 assert_routing(
105 { :method => 'get', :path => "/custom_fields/new" },
105 { :method => 'get', :path => "/custom_fields/new" },
106 { :controller => 'custom_fields', :action => 'new' }
106 { :controller => 'custom_fields', :action => 'new' }
107 )
107 )
108 assert_routing(
108 assert_routing(
109 { :method => 'post', :path => "/custom_fields" },
109 { :method => 'post', :path => "/custom_fields" },
110 { :controller => 'custom_fields', :action => 'create' }
110 { :controller => 'custom_fields', :action => 'create' }
111 )
111 )
112 assert_routing(
112 assert_routing(
113 { :method => 'get', :path => "/custom_fields/2/edit" },
113 { :method => 'get', :path => "/custom_fields/2/edit" },
114 { :controller => 'custom_fields', :action => 'edit', :id => '2' }
114 { :controller => 'custom_fields', :action => 'edit', :id => '2' }
115 )
115 )
116 assert_routing(
116 assert_routing(
117 { :method => 'put', :path => "/custom_fields/2" },
117 { :method => 'put', :path => "/custom_fields/2" },
118 { :controller => 'custom_fields', :action => 'update', :id => '2' }
118 { :controller => 'custom_fields', :action => 'update', :id => '2' }
119 )
119 )
120 assert_routing(
120 assert_routing(
121 { :method => 'delete', :path => "/custom_fields/2" },
121 { :method => 'delete', :path => "/custom_fields/2" },
122 { :controller => 'custom_fields', :action => 'destroy', :id => '2' }
122 { :controller => 'custom_fields', :action => 'destroy', :id => '2' }
123 )
123 )
124 end
124 end
125
125
126 context "documents" do
126 context "documents" do
127 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
127 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
128 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
128 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
129 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
129 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
130 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
130 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
131
131
132 should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567'
132 should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567'
133 should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22'
133 should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22'
134 should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22'
134 should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22'
135
135
136 should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22'
136 should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22'
137 end
137 end
138
138
139 context "roles" do
139 context "roles" do
140 should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index'
140 should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index'
141 should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new'
141 should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new'
142 should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create'
142 should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create'
143 should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2
143 should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2
144 should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2
144 should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2
145 should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2
145 should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2
146 end
146 end
147
147
148 context "groups" do
148 context "groups" do
149 should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567'
149 should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567'
150 should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12'
150 should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12'
151 end
151 end
152
152
153 def test_issues_rest_actions
154 assert_routing(
155 { :method => 'get', :path => "/issues" },
156 { :controller => 'issues', :action => 'index' }
157 )
158 assert_routing(
159 { :method => 'get', :path => "/issues.pdf" },
160 { :controller => 'issues', :action => 'index', :format => 'pdf' }
161 )
162 assert_routing(
163 { :method => 'get', :path => "/issues.atom" },
164 { :controller => 'issues', :action => 'index', :format => 'atom' }
165 )
166 assert_routing(
167 { :method => 'get', :path => "/issues.xml" },
168 { :controller => 'issues', :action => 'index', :format => 'xml' }
169 )
170 assert_routing(
171 { :method => 'get', :path => "/projects/23/issues" },
172 { :controller => 'issues', :action => 'index', :project_id => '23' }
173 )
174 assert_routing(
175 { :method => 'get', :path => "/projects/23/issues.pdf" },
176 { :controller => 'issues', :action => 'index', :project_id => '23',
177 :format => 'pdf' }
178 )
179 assert_routing(
180 { :method => 'get', :path => "/projects/23/issues.atom" },
181 { :controller => 'issues', :action => 'index', :project_id => '23',
182 :format => 'atom' }
183 )
184 assert_routing(
185 { :method => 'get', :path => "/projects/23/issues.xml" },
186 { :controller => 'issues', :action => 'index', :project_id => '23',
187 :format => 'xml' }
188 )
189 assert_routing(
190 { :method => 'get', :path => "/issues/64" },
191 { :controller => 'issues', :action => 'show', :id => '64' }
192 )
193 assert_routing(
194 { :method => 'get', :path => "/issues/64.pdf" },
195 { :controller => 'issues', :action => 'show', :id => '64',
196 :format => 'pdf' }
197 )
198 assert_routing(
199 { :method => 'get', :path => "/issues/64.atom" },
200 { :controller => 'issues', :action => 'show', :id => '64',
201 :format => 'atom' }
202 )
203 assert_routing(
204 { :method => 'get', :path => "/issues/64.xml" },
205 { :controller => 'issues', :action => 'show', :id => '64',
206 :format => 'xml' }
207 )
208 assert_routing(
209 { :method => 'get', :path => "/projects/23/issues/new" },
210 { :controller => 'issues', :action => 'new', :project_id => '23' }
211 )
212 end
213
153 context "issues" do
214 context "issues" do
154 # REST actions
155 should_route :get, "/issues", :controller => 'issues', :action => 'index'
156 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
157 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
158 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
159 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
160 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
161 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
162 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
163 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
164 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
165 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
166 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
167
168 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
169 # issue form update
215 # issue form update
170 should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
216 should_route :post, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
171 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
217 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
172 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
218 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
173
219
174 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
220 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
175 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
221 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
176
222
177 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
223 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
178
224
179 # Extra actions
225 # Extra actions
180 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
226 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
181
227
182 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
228 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
183 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
229 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
184
230
185 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
231 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
186
232
187 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
233 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
188 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
234 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
189
235
190 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
236 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
191 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
237 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
192 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
238 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
193 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
239 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
194
240
195 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
241 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
196
242
197 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
243 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
198 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
244 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
199 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
245 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
200 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
246 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
201
247
202 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
248 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
203
249
204 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
250 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
205 should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update'
251 should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update'
206 end
252 end
207
253
208 context "issue categories" do
254 context "issue categories" do
209 should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo'
255 should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo'
210 should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml'
256 should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml'
211 should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json'
257 should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json'
212
258
213 should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo'
259 should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo'
214
260
215 should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo'
261 should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo'
216 should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml'
262 should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml'
217 should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json'
263 should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json'
218
264
219 should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1'
265 should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1'
220 should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml'
266 should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml'
221 should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json'
267 should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json'
222
268
223 should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1'
269 should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1'
224
270
225 should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1'
271 should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1'
226 should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml'
272 should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml'
227 should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json'
273 should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json'
228
274
229 should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1'
275 should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1'
230 should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml'
276 should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml'
231 should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
277 should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
232 end
278 end
233
279
234 context "issue relations" do
280 context "issue relations" do
235 should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
281 should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
236 should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
282 should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
237 should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
283 should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
238
284
239 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
285 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
240 should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
286 should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
241 should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
287 should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
242
288
243 should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
289 should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
244 should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
290 should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
245 should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
291 should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
246
292
247 should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
293 should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
248 should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
294 should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
249 should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
295 should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
250 end
296 end
251
297
252 def test_issue_reports
298 def test_issue_reports
253 assert_routing(
299 assert_routing(
254 { :method => 'get', :path => "/projects/567/issues/report" },
300 { :method => 'get', :path => "/projects/567/issues/report" },
255 { :controller => 'reports', :action => 'issue_report', :id => '567' }
301 { :controller => 'reports', :action => 'issue_report', :id => '567' }
256 )
302 )
257 assert_routing(
303 assert_routing(
258 { :method => 'get', :path => "/projects/567/issues/report/assigned_to" },
304 { :method => 'get', :path => "/projects/567/issues/report/assigned_to" },
259 { :controller => 'reports', :action => 'issue_report_details',
305 { :controller => 'reports', :action => 'issue_report_details',
260 :id => '567', :detail => 'assigned_to' }
306 :id => '567', :detail => 'assigned_to' }
261 )
307 )
262 end
308 end
263
309
264 def test_members
310 def test_members
265 assert_routing(
311 assert_routing(
266 { :method => 'post', :path => "/projects/5234/members/new" },
312 { :method => 'post', :path => "/projects/5234/members/new" },
267 { :controller => 'members', :action => 'new', :id => '5234' }
313 { :controller => 'members', :action => 'new', :id => '5234' }
268 )
314 )
269 end
315 end
270
316
271 context "messages" do
317 context "messages" do
272 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
318 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
273 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
319 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
274 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
320 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
275
321
276 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
322 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
277 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
323 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
278 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
324 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
279 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
325 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
280 end
326 end
281
327
282 context "news" do
328 context "news" do
283 should_route :get, "/news", :controller => 'news', :action => 'index'
329 should_route :get, "/news", :controller => 'news', :action => 'index'
284 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
330 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
285 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
331 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
286 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
332 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
287 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
333 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
288 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
334 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
289 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
335 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
290 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
336 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
291 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
337 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
292 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
338 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
293 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
339 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
294 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
340 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
295 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
341 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
296
342
297 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
343 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
298 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
344 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
299
345
300 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
346 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
301
347
302 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
348 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
303 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
349 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
304 end
350 end
305
351
306 context "projects" do
352 context "projects" do
307 should_route :get, "/projects", :controller => 'projects', :action => 'index'
353 should_route :get, "/projects", :controller => 'projects', :action => 'index'
308 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
354 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
309 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
355 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
310 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
356 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
311 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
357 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
312 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
358 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
313 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
359 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
314 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
360 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
315 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
361 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
316 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
362 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
317 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
363 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
318 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
364 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
319 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
365 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
320
366
321 should_route :post, "/projects", :controller => 'projects', :action => 'create'
367 should_route :post, "/projects", :controller => 'projects', :action => 'create'
322 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
368 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
323 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
369 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
324 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
370 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
325 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
371 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
326
372
327 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
373 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
328 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
374 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
329 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
375 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
330
376
331 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
377 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
332 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
378 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
333 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
379 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
334 end
380 end
335
381
336 context "queries" do
382 context "queries" do
337 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
383 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
338 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
384 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
339
385
340 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
386 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
341 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
387 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
342
388
343 should_route :post, "/queries", :controller => 'queries', :action => 'create'
389 should_route :post, "/queries", :controller => 'queries', :action => 'create'
344 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
390 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
345
391
346 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
392 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
347
393
348 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
394 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
349
395
350 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
396 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
351 end
397 end
352
398
353 context "repositories" do
399 context "repositories" do
354 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
400 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
355 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
401 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
356 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
402 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
357 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
403 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
358 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
404 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
359 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
405 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
360 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
406 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
361 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
407 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
362 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
408 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
363 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
409 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
364 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
410 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
365 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
411 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
366 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
412 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
367 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
413 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
368 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
414 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
369 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
415 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
370 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
416 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
371
417
372 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
418 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
373 end
419 end
374
420
375 context "roles" do
421 context "roles" do
376 should_route :get, "/roles", :controller => 'roles', :action => 'index'
422 should_route :get, "/roles", :controller => 'roles', :action => 'index'
377 should_route :get, "/roles/new", :controller => 'roles', :action => 'new'
423 should_route :get, "/roles/new", :controller => 'roles', :action => 'new'
378 should_route :post, "/roles", :controller => 'roles', :action => 'create'
424 should_route :post, "/roles", :controller => 'roles', :action => 'create'
379 should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2
425 should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2
380 should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2
426 should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2
381 should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2
427 should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2
382 should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions'
428 should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions'
383 should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions'
429 should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions'
384 end
430 end
385
431
386 context "timelogs (global)" do
432 context "timelogs (global)" do
387 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
433 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
388 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
434 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
389 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
435 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
390 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
436 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
391 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
437 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
392
438
393 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
439 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
394
440
395 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
441 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
396
442
397 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
443 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
398 end
444 end
399
445
400 context "timelogs (scoped under project)" do
446 context "timelogs (scoped under project)" do
401 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
447 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
402 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
448 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
403 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
449 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
404 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
450 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
405 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
451 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
406
452
407 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
453 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
408
454
409 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
455 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
410
456
411 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
457 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
412 end
458 end
413
459
414 context "timelogs (scoped under issues)" do
460 context "timelogs (scoped under issues)" do
415 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
461 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
416 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
462 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
417 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
463 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
418 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
464 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
419 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
465 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
420
466
421 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
467 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
422
468
423 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
469 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
424
470
425 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
471 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
426 end
472 end
427
473
428 context "timelogs (scoped under project and issues)" do
474 context "timelogs (scoped under project and issues)" do
429 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
475 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
430 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
476 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
431 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
477 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
432 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
478 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
433 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
479 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
434
480
435 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
481 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
436
482
437 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
483 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
438
484
439 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
485 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
440
486
441 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
487 should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report'
442 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
488 should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567'
443 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
489 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv'
444 end
490 end
445
491
446 context "users" do
492 context "users" do
447 should_route :get, "/users", :controller => 'users', :action => 'index'
493 should_route :get, "/users", :controller => 'users', :action => 'index'
448 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
494 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
449 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
495 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
450 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
496 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
451 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
497 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
452 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
498 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
453 should_route :get, "/users/new", :controller => 'users', :action => 'new'
499 should_route :get, "/users/new", :controller => 'users', :action => 'new'
454 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
500 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
455
501
456 should_route :post, "/users", :controller => 'users', :action => 'create'
502 should_route :post, "/users", :controller => 'users', :action => 'create'
457 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
503 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
458
504
459 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
505 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
460 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
506 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
461
507
462 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
508 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
463 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
509 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
464
510
465 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
511 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
466 should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
512 should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
467 should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55'
513 should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55'
468 end
514 end
469
515
470 context "versions" do
516 context "versions" do
471 # /projects/foo/versions is /projects/foo/roadmap
517 # /projects/foo/versions is /projects/foo/roadmap
472 should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml'
518 should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml'
473 should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json'
519 should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json'
474
520
475 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
521 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
476
522
477 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
523 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
478 should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml'
524 should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml'
479 should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json'
525 should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json'
480
526
481 should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1'
527 should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1'
482 should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml'
528 should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml'
483 should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json'
529 should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json'
484
530
485 should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1'
531 should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1'
486
532
487 should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1'
533 should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1'
488 should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml'
534 should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml'
489 should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json'
535 should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json'
490
536
491 should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1'
537 should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1'
492 should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml'
538 should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml'
493 should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json'
539 should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json'
494
540
495 should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo'
541 should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo'
496 should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1'
542 should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1'
497 end
543 end
498
544
499 def test_welcome
545 def test_welcome
500 assert_routing(
546 assert_routing(
501 { :method => 'get', :path => "/robots.txt" },
547 { :method => 'get', :path => "/robots.txt" },
502 { :controller => 'welcome', :action => 'robots' }
548 { :controller => 'welcome', :action => 'robots' }
503 )
549 )
504 end
550 end
505
551
506 context "wiki (singular, project's pages)" do
552 context "wiki (singular, project's pages)" do
507 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
553 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
508 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
554 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
509 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
555 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
510 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
556 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
511 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
557 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
512 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
558 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
513 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
559 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
514 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
560 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
515 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
561 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
516 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
562 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
517 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
563 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
518 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
564 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
519
565
520 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
566 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
521 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
567 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
522 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
568 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
523 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
569 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
524
570
525 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
571 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
526
572
527 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
573 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
528 end
574 end
529
575
530 def test_wikis_plural_admin_setup
576 def test_wikis_plural_admin_setup
531 assert_routing(
577 assert_routing(
532 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
578 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
533 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
579 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
534 )
580 )
535 assert_routing(
581 assert_routing(
536 { :method => 'post', :path => "/projects/ladida/wiki" },
582 { :method => 'post', :path => "/projects/ladida/wiki" },
537 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
583 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
538 )
584 )
539 assert_routing(
585 assert_routing(
540 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
586 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
541 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
587 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
542 )
588 )
543 end
589 end
544
590
545 def test_administration_panel
591 def test_administration_panel
546 assert_routing(
592 assert_routing(
547 { :method => 'get', :path => "/admin/projects" },
593 { :method => 'get', :path => "/admin/projects" },
548 { :controller => 'admin', :action => 'projects' }
594 { :controller => 'admin', :action => 'projects' }
549 )
595 )
550 end
596 end
551 end
597 end
General Comments 0
You need to be logged in to leave comments. Login now