##// END OF EJS Templates
test: route: move versions test in projects test to routing/versions_test.rb...
Toshi MARUYAMA -
r8231:4b8ceb51e210
parent child
Show More
@@ -1,109 +1,113
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../../test_helper', __FILE__)
19 19
20 20 class RoutingVersionsTest < ActionController::IntegrationTest
21 21 def test_versions
22 22 # /projects/foo/versions is /projects/foo/roadmap
23 23 assert_routing(
24 { :method => 'get', :path => "/projects/33/roadmap" },
25 { :controller => 'versions', :action => 'index', :project_id => '33' }
26 )
27 assert_routing(
24 28 { :method => 'get', :path => "/projects/foo/versions.xml" },
25 29 { :controller => 'versions', :action => 'index',
26 30 :project_id => 'foo', :format => 'xml' }
27 31 )
28 32 assert_routing(
29 33 { :method => 'get', :path => "/projects/foo/versions.json" },
30 34 { :controller => 'versions', :action => 'index',
31 35 :project_id => 'foo', :format => 'json' }
32 36 )
33 37 assert_routing(
34 38 { :method => 'get', :path => "/projects/foo/versions/new" },
35 39 { :controller => 'versions', :action => 'new',
36 40 :project_id => 'foo' }
37 41 )
38 42 assert_routing(
39 43 { :method => 'post', :path => "/projects/foo/versions" },
40 44 { :controller => 'versions', :action => 'create',
41 45 :project_id => 'foo' }
42 46 )
43 47 assert_routing(
44 48 { :method => 'post', :path => "/projects/foo/versions.xml" },
45 49 { :controller => 'versions', :action => 'create',
46 50 :project_id => 'foo', :format => 'xml' }
47 51 )
48 52 assert_routing(
49 53 { :method => 'post', :path => "/projects/foo/versions.json" },
50 54 { :controller => 'versions', :action => 'create',
51 55 :project_id => 'foo', :format => 'json' }
52 56 )
53 57 assert_routing(
54 58 { :method => 'get', :path => "/versions/1" },
55 59 { :controller => 'versions', :action => 'show', :id => '1' }
56 60 )
57 61 assert_routing(
58 62 { :method => 'get', :path => "/versions/1.xml" },
59 63 { :controller => 'versions', :action => 'show', :id => '1',
60 64 :format => 'xml' }
61 65 )
62 66 assert_routing(
63 67 { :method => 'get', :path => "/versions/1.json" },
64 68 { :controller => 'versions', :action => 'show', :id => '1',
65 69 :format => 'json' }
66 70 )
67 71 assert_routing(
68 72 { :method => 'get', :path => "/versions/1/edit" },
69 73 { :controller => 'versions', :action => 'edit', :id => '1' }
70 74 )
71 75 assert_routing(
72 76 { :method => 'put', :path => "/versions/1" },
73 77 { :controller => 'versions', :action => 'update', :id => '1' }
74 78 )
75 79 assert_routing(
76 80 { :method => 'put', :path => "/versions/1.xml" },
77 81 { :controller => 'versions', :action => 'update', :id => '1',
78 82 :format => 'xml' }
79 83 )
80 84 assert_routing(
81 85 { :method => 'put', :path => "/versions/1.json" },
82 86 { :controller => 'versions', :action => 'update', :id => '1',
83 87 :format => 'json' }
84 88 )
85 89 assert_routing(
86 90 { :method => 'delete', :path => "/versions/1" },
87 91 { :controller => 'versions', :action => 'destroy', :id => '1' }
88 92 )
89 93 assert_routing(
90 94 { :method => 'delete', :path => "/versions/1.xml" },
91 95 { :controller => 'versions', :action => 'destroy', :id => '1',
92 96 :format => 'xml' }
93 97 )
94 98 assert_routing(
95 99 { :method => 'delete', :path => "/versions/1.json" },
96 100 { :controller => 'versions', :action => 'destroy', :id => '1',
97 101 :format => 'json' }
98 102 )
99 103 assert_routing(
100 104 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
101 105 { :controller => 'versions', :action => 'close_completed',
102 106 :project_id => 'foo' }
103 107 )
104 108 assert_routing(
105 109 { :method => 'post', :path => "/versions/1/status_by" },
106 110 { :controller => 'versions', :action => 'status_by', :id => '1' }
107 111 )
108 112 end
109 113 end
@@ -1,533 +1,529
1 1 # Redmine - project management software
2 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 3 #
4 4 # This program is free software; you can redistribute it and/or
5 5 # modify it under the terms of the GNU General Public License
6 6 # as published by the Free Software Foundation; either version 2
7 7 # of the License, or (at your option) any later version.
8 8 #
9 9 # This program is distributed in the hope that it will be useful,
10 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 12 # GNU General Public License for more details.
13 13 #
14 14 # You should have received a copy of the GNU General Public License
15 15 # along with this program; if not, write to the Free Software
16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 17
18 18 require File.expand_path('../../test_helper', __FILE__)
19 19
20 20 class RoutingTest < ActionController::IntegrationTest
21 21 def test_issues_rest_actions
22 22 assert_routing(
23 23 { :method => 'get', :path => "/issues" },
24 24 { :controller => 'issues', :action => 'index' }
25 25 )
26 26 assert_routing(
27 27 { :method => 'get', :path => "/issues.pdf" },
28 28 { :controller => 'issues', :action => 'index', :format => 'pdf' }
29 29 )
30 30 assert_routing(
31 31 { :method => 'get', :path => "/issues.atom" },
32 32 { :controller => 'issues', :action => 'index', :format => 'atom' }
33 33 )
34 34 assert_routing(
35 35 { :method => 'get', :path => "/issues.xml" },
36 36 { :controller => 'issues', :action => 'index', :format => 'xml' }
37 37 )
38 38 assert_routing(
39 39 { :method => 'get', :path => "/projects/23/issues" },
40 40 { :controller => 'issues', :action => 'index', :project_id => '23' }
41 41 )
42 42 assert_routing(
43 43 { :method => 'get', :path => "/projects/23/issues.pdf" },
44 44 { :controller => 'issues', :action => 'index', :project_id => '23',
45 45 :format => 'pdf' }
46 46 )
47 47 assert_routing(
48 48 { :method => 'get', :path => "/projects/23/issues.atom" },
49 49 { :controller => 'issues', :action => 'index', :project_id => '23',
50 50 :format => 'atom' }
51 51 )
52 52 assert_routing(
53 53 { :method => 'get', :path => "/projects/23/issues.xml" },
54 54 { :controller => 'issues', :action => 'index', :project_id => '23',
55 55 :format => 'xml' }
56 56 )
57 57 assert_routing(
58 58 { :method => 'get', :path => "/issues/64" },
59 59 { :controller => 'issues', :action => 'show', :id => '64' }
60 60 )
61 61 assert_routing(
62 62 { :method => 'get', :path => "/issues/64.pdf" },
63 63 { :controller => 'issues', :action => 'show', :id => '64',
64 64 :format => 'pdf' }
65 65 )
66 66 assert_routing(
67 67 { :method => 'get', :path => "/issues/64.atom" },
68 68 { :controller => 'issues', :action => 'show', :id => '64',
69 69 :format => 'atom' }
70 70 )
71 71 assert_routing(
72 72 { :method => 'get', :path => "/issues/64.xml" },
73 73 { :controller => 'issues', :action => 'show', :id => '64',
74 74 :format => 'xml' }
75 75 )
76 76 assert_routing(
77 77 { :method => 'get', :path => "/projects/23/issues/new" },
78 78 { :controller => 'issues', :action => 'new', :project_id => '23' }
79 79 )
80 80 end
81 81
82 82 def test_issues_form_update
83 83 assert_routing(
84 84 { :method => 'post', :path => "/projects/23/issues/new" },
85 85 { :controller => 'issues', :action => 'new', :project_id => '23' }
86 86 )
87 87 assert_routing(
88 88 { :method => 'post', :path => "/projects/23/issues" },
89 89 { :controller => 'issues', :action => 'create', :project_id => '23' }
90 90 )
91 91 assert_routing(
92 92 { :method => 'post', :path => "/issues.xml" },
93 93 { :controller => 'issues', :action => 'create', :format => 'xml' }
94 94 )
95 95 assert_routing(
96 96 { :method => 'get', :path => "/issues/64/edit" },
97 97 { :controller => 'issues', :action => 'edit', :id => '64' }
98 98 )
99 99 assert_routing(
100 100 { :method => 'put', :path => "/issues/1.xml" },
101 101 { :controller => 'issues', :action => 'update', :id => '1',
102 102 :format => 'xml' }
103 103 )
104 104 assert_routing(
105 105 { :method => 'delete', :path => "/issues/1.xml" },
106 106 { :controller => 'issues', :action => 'destroy', :id => '1',
107 107 :format => 'xml' }
108 108 )
109 109 end
110 110
111 111 def test_issues_extra_actions
112 112 assert_routing(
113 113 { :method => 'get', :path => "/projects/23/issues/64/copy" },
114 114 { :controller => 'issues', :action => 'new', :project_id => '23',
115 115 :copy_from => '64' }
116 116 )
117 117 assert_routing(
118 118 { :method => 'get', :path => "/issues/preview/123" },
119 119 { :controller => 'previews', :action => 'issue', :id => '123' }
120 120 )
121 121 assert_routing(
122 122 { :method => 'post', :path => "/issues/preview/123" },
123 123 { :controller => 'previews', :action => 'issue', :id => '123' }
124 124 )
125 125 assert_routing(
126 126 { :method => 'get', :path => "/issues/context_menu" },
127 127 { :controller => 'context_menus', :action => 'issues' }
128 128 )
129 129 assert_routing(
130 130 { :method => 'post', :path => "/issues/context_menu" },
131 131 { :controller => 'context_menus', :action => 'issues' }
132 132 )
133 133 assert_routing(
134 134 { :method => 'get', :path => "/issues/bulk_edit" },
135 135 { :controller => 'issues', :action => 'bulk_edit' }
136 136 )
137 137 assert_routing(
138 138 { :method => 'post', :path => "/issues/bulk_update" },
139 139 { :controller => 'issues', :action => 'bulk_update' }
140 140 )
141 141 end
142 142
143 143 def test_issue_categories
144 144 assert_routing(
145 145 { :method => 'get', :path => "/projects/foo/issue_categories" },
146 146 { :controller => 'issue_categories', :action => 'index',
147 147 :project_id => 'foo' }
148 148 )
149 149 assert_routing(
150 150 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
151 151 { :controller => 'issue_categories', :action => 'index',
152 152 :project_id => 'foo', :format => 'xml' }
153 153 )
154 154 assert_routing(
155 155 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
156 156 { :controller => 'issue_categories', :action => 'index',
157 157 :project_id => 'foo', :format => 'json' }
158 158 )
159 159 assert_routing(
160 160 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
161 161 { :controller => 'issue_categories', :action => 'new',
162 162 :project_id => 'foo' }
163 163 )
164 164 assert_routing(
165 165 { :method => 'post', :path => "/projects/foo/issue_categories" },
166 166 { :controller => 'issue_categories', :action => 'create',
167 167 :project_id => 'foo' }
168 168 )
169 169 assert_routing(
170 170 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
171 171 { :controller => 'issue_categories', :action => 'create',
172 172 :project_id => 'foo', :format => 'xml' }
173 173 )
174 174 assert_routing(
175 175 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
176 176 { :controller => 'issue_categories', :action => 'create',
177 177 :project_id => 'foo', :format => 'json' }
178 178 )
179 179 assert_routing(
180 180 { :method => 'get', :path => "/issue_categories/1" },
181 181 { :controller => 'issue_categories', :action => 'show', :id => '1' }
182 182 )
183 183 assert_routing(
184 184 { :method => 'get', :path => "/issue_categories/1.xml" },
185 185 { :controller => 'issue_categories', :action => 'show', :id => '1',
186 186 :format => 'xml' }
187 187 )
188 188 assert_routing(
189 189 { :method => 'get', :path => "/issue_categories/1.json" },
190 190 { :controller => 'issue_categories', :action => 'show', :id => '1',
191 191 :format => 'json' }
192 192 )
193 193 assert_routing(
194 194 { :method => 'get', :path => "/issue_categories/1/edit" },
195 195 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
196 196 )
197 197 assert_routing(
198 198 { :method => 'put', :path => "/issue_categories/1" },
199 199 { :controller => 'issue_categories', :action => 'update', :id => '1' }
200 200 )
201 201 assert_routing(
202 202 { :method => 'put', :path => "/issue_categories/1.xml" },
203 203 { :controller => 'issue_categories', :action => 'update', :id => '1',
204 204 :format => 'xml' }
205 205 )
206 206 assert_routing(
207 207 { :method => 'put', :path => "/issue_categories/1.json" },
208 208 { :controller => 'issue_categories', :action => 'update', :id => '1',
209 209 :format => 'json' }
210 210 )
211 211 assert_routing(
212 212 { :method => 'delete', :path => "/issue_categories/1" },
213 213 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
214 214 )
215 215 assert_routing(
216 216 { :method => 'delete', :path => "/issue_categories/1.xml" },
217 217 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
218 218 :format => 'xml' }
219 219 )
220 220 assert_routing(
221 221 { :method => 'delete', :path => "/issue_categories/1.json" },
222 222 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
223 223 :format => 'json' }
224 224 )
225 225 end
226 226
227 227 def test_news
228 228 assert_routing(
229 229 { :method => 'get', :path => "/news" },
230 230 { :controller => 'news', :action => 'index' }
231 231 )
232 232 assert_routing(
233 233 { :method => 'get', :path => "/news.atom" },
234 234 { :controller => 'news', :action => 'index', :format => 'atom' }
235 235 )
236 236 assert_routing(
237 237 { :method => 'get', :path => "/news.xml" },
238 238 { :controller => 'news', :action => 'index', :format => 'xml' }
239 239 )
240 240 assert_routing(
241 241 { :method => 'get', :path => "/news.json" },
242 242 { :controller => 'news', :action => 'index', :format => 'json' }
243 243 )
244 244 assert_routing(
245 245 { :method => 'get', :path => "/projects/567/news" },
246 246 { :controller => 'news', :action => 'index', :project_id => '567' }
247 247 )
248 248 assert_routing(
249 249 { :method => 'get', :path => "/projects/567/news.atom" },
250 250 { :controller => 'news', :action => 'index', :format => 'atom',
251 251 :project_id => '567' }
252 252 )
253 253 assert_routing(
254 254 { :method => 'get', :path => "/projects/567/news.xml" },
255 255 { :controller => 'news', :action => 'index', :format => 'xml',
256 256 :project_id => '567' }
257 257 )
258 258 assert_routing(
259 259 { :method => 'get', :path => "/projects/567/news.json" },
260 260 { :controller => 'news', :action => 'index', :format => 'json',
261 261 :project_id => '567' }
262 262 )
263 263 assert_routing(
264 264 { :method => 'get', :path => "/news/2" },
265 265 { :controller => 'news', :action => 'show', :id => '2' }
266 266 )
267 267 assert_routing(
268 268 { :method => 'get', :path => "/projects/567/news/new" },
269 269 { :controller => 'news', :action => 'new', :project_id => '567' }
270 270 )
271 271 assert_routing(
272 272 { :method => 'get', :path => "/news/234" },
273 273 { :controller => 'news', :action => 'show', :id => '234' }
274 274 )
275 275 assert_routing(
276 276 { :method => 'get', :path => "/news/567/edit" },
277 277 { :controller => 'news', :action => 'edit', :id => '567' }
278 278 )
279 279 assert_routing(
280 280 { :method => 'get', :path => "/news/preview" },
281 281 { :controller => 'previews', :action => 'news' }
282 282 )
283 283 assert_routing(
284 284 { :method => 'post', :path => "/projects/567/news" },
285 285 { :controller => 'news', :action => 'create', :project_id => '567' }
286 286 )
287 287 assert_routing(
288 288 { :method => 'post', :path => "/news/567/comments" },
289 289 { :controller => 'comments', :action => 'create', :id => '567' }
290 290 )
291 291 assert_routing(
292 292 { :method => 'put', :path => "/news/567" },
293 293 { :controller => 'news', :action => 'update', :id => '567' }
294 294 )
295 295 assert_routing(
296 296 { :method => 'delete', :path => "/news/567" },
297 297 { :controller => 'news', :action => 'destroy', :id => '567' }
298 298 )
299 299 assert_routing(
300 300 { :method => 'delete', :path => "/news/567/comments/15" },
301 301 { :controller => 'comments', :action => 'destroy', :id => '567',
302 302 :comment_id => '15' }
303 303 )
304 304 end
305 305
306 306 def test_projects
307 307 assert_routing(
308 308 { :method => 'get', :path => "/projects" },
309 309 { :controller => 'projects', :action => 'index' }
310 310 )
311 311 assert_routing(
312 312 { :method => 'get', :path => "/projects.atom" },
313 313 { :controller => 'projects', :action => 'index', :format => 'atom' }
314 314 )
315 315 assert_routing(
316 316 { :method => 'get', :path => "/projects.xml" },
317 317 { :controller => 'projects', :action => 'index', :format => 'xml' }
318 318 )
319 319 assert_routing(
320 320 { :method => 'get', :path => "/projects/new" },
321 321 { :controller => 'projects', :action => 'new' }
322 322 )
323 323 assert_routing(
324 324 { :method => 'get', :path => "/projects/test" },
325 325 { :controller => 'projects', :action => 'show', :id => 'test' }
326 326 )
327 327 assert_routing(
328 328 { :method => 'get', :path => "/projects/1.xml" },
329 329 { :controller => 'projects', :action => 'show', :id => '1',
330 330 :format => 'xml' }
331 331 )
332 332 assert_routing(
333 333 { :method => 'get', :path => "/projects/4223/settings" },
334 334 { :controller => 'projects', :action => 'settings', :id => '4223' }
335 335 )
336 336 assert_routing(
337 337 { :method => 'get', :path => "/projects/4223/settings/members" },
338 338 { :controller => 'projects', :action => 'settings', :id => '4223',
339 339 :tab => 'members' }
340 340 )
341 341 assert_routing(
342 { :method => 'get', :path => "/projects/33/roadmap" },
343 { :controller => 'versions', :action => 'index', :project_id => '33' }
344 )
345 assert_routing(
346 342 { :method => 'post', :path => "/projects" },
347 343 { :controller => 'projects', :action => 'create' }
348 344 )
349 345 assert_routing(
350 346 { :method => 'post', :path => "/projects.xml" },
351 347 { :controller => 'projects', :action => 'create', :format => 'xml' }
352 348 )
353 349 assert_routing(
354 350 { :method => 'post', :path => "/projects/64/archive" },
355 351 { :controller => 'projects', :action => 'archive', :id => '64' }
356 352 )
357 353 assert_routing(
358 354 { :method => 'post', :path => "/projects/64/unarchive" },
359 355 { :controller => 'projects', :action => 'unarchive', :id => '64' }
360 356 )
361 357 assert_routing(
362 358 { :method => 'put', :path => "/projects/64/enumerations" },
363 359 { :controller => 'project_enumerations', :action => 'update',
364 360 :project_id => '64' }
365 361 )
366 362 assert_routing(
367 363 { :method => 'put', :path => "/projects/4223" },
368 364 { :controller => 'projects', :action => 'update', :id => '4223' }
369 365 )
370 366 assert_routing(
371 367 { :method => 'put', :path => "/projects/1.xml" },
372 368 { :controller => 'projects', :action => 'update', :id => '1',
373 369 :format => 'xml' }
374 370 )
375 371 assert_routing(
376 372 { :method => 'delete', :path => "/projects/64" },
377 373 { :controller => 'projects', :action => 'destroy', :id => '64' }
378 374 )
379 375 assert_routing(
380 376 { :method => 'delete', :path => "/projects/1.xml" },
381 377 { :controller => 'projects', :action => 'destroy', :id => '1',
382 378 :format => 'xml' }
383 379 )
384 380 assert_routing(
385 381 { :method => 'delete', :path => "/projects/64/enumerations" },
386 382 { :controller => 'project_enumerations', :action => 'destroy',
387 383 :project_id => '64' }
388 384 )
389 385 end
390 386
391 387 def test_queries
392 388 assert_routing(
393 389 { :method => 'get', :path => "/queries.xml" },
394 390 { :controller => 'queries', :action => 'index', :format => 'xml' }
395 391 )
396 392 assert_routing(
397 393 { :method => 'get', :path => "/queries.json" },
398 394 { :controller => 'queries', :action => 'index', :format => 'json' }
399 395 )
400 396 assert_routing(
401 397 { :method => 'get', :path => "/queries/new" },
402 398 { :controller => 'queries', :action => 'new' }
403 399 )
404 400 assert_routing(
405 401 { :method => 'get', :path => "/projects/redmine/queries/new" },
406 402 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
407 403 )
408 404 assert_routing(
409 405 { :method => 'post', :path => "/queries" },
410 406 { :controller => 'queries', :action => 'create' }
411 407 )
412 408 assert_routing(
413 409 { :method => 'post', :path => "/projects/redmine/queries" },
414 410 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
415 411 )
416 412 assert_routing(
417 413 { :method => 'get', :path => "/queries/1/edit" },
418 414 { :controller => 'queries', :action => 'edit', :id => '1' }
419 415 )
420 416 assert_routing(
421 417 { :method => 'put', :path => "/queries/1" },
422 418 { :controller => 'queries', :action => 'update', :id => '1' }
423 419 )
424 420 assert_routing(
425 421 { :method => 'delete', :path => "/queries/1" },
426 422 { :controller => 'queries', :action => 'destroy', :id => '1' }
427 423 )
428 424 end
429 425
430 426 def test_wiki_singular_projects_pages
431 427 assert_routing(
432 428 { :method => 'get', :path => "/projects/567/wiki" },
433 429 { :controller => 'wiki', :action => 'show', :project_id => '567' }
434 430 )
435 431 assert_routing(
436 432 { :method => 'get', :path => "/projects/567/wiki/lalala" },
437 433 { :controller => 'wiki', :action => 'show', :project_id => '567',
438 434 :id => 'lalala' }
439 435 )
440 436 assert_routing(
441 437 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
442 438 { :controller => 'wiki', :action => 'edit', :project_id => '567',
443 439 :id => 'my_page' }
444 440 )
445 441 assert_routing(
446 442 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
447 443 { :controller => 'wiki', :action => 'history', :project_id => '1',
448 444 :id => 'CookBook_documentation' }
449 445 )
450 446 assert_routing(
451 447 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
452 448 { :controller => 'wiki', :action => 'diff', :project_id => '1',
453 449 :id => 'CookBook_documentation' }
454 450 )
455 451 assert_routing(
456 452 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
457 453 { :controller => 'wiki', :action => 'diff', :project_id => '1',
458 454 :id => 'CookBook_documentation', :version => '2' }
459 455 )
460 456 assert_routing(
461 457 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
462 458 { :controller => 'wiki', :action => 'diff', :project_id => '1',
463 459 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
464 460 )
465 461 assert_routing(
466 462 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
467 463 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
468 464 :id => 'CookBook_documentation', :version => '2' }
469 465 )
470 466 assert_routing(
471 467 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
472 468 { :controller => 'wiki', :action => 'rename', :project_id => '22',
473 469 :id => 'ladida' }
474 470 )
475 471 assert_routing(
476 472 { :method => 'get', :path => "/projects/567/wiki/index" },
477 473 { :controller => 'wiki', :action => 'index', :project_id => '567' }
478 474 )
479 475 assert_routing(
480 476 { :method => 'get', :path => "/projects/567/wiki/date_index" },
481 477 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
482 478 )
483 479 assert_routing(
484 480 { :method => 'get', :path => "/projects/567/wiki/export" },
485 481 { :controller => 'wiki', :action => 'export', :project_id => '567' }
486 482 )
487 483 assert_routing(
488 484 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
489 485 { :controller => 'wiki', :action => 'preview', :project_id => '567',
490 486 :id => 'CookBook_documentation' }
491 487 )
492 488 assert_routing(
493 489 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
494 490 { :controller => 'wiki', :action => 'rename', :project_id => '22',
495 491 :id => 'ladida' }
496 492 )
497 493 assert_routing(
498 494 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
499 495 { :controller => 'wiki', :action => 'protect', :project_id => '22',
500 496 :id => 'ladida' }
501 497 )
502 498 assert_routing(
503 499 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
504 500 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
505 501 :id => 'ladida' }
506 502 )
507 503 assert_routing(
508 504 { :method => 'put', :path => "/projects/567/wiki/my_page" },
509 505 { :controller => 'wiki', :action => 'update', :project_id => '567',
510 506 :id => 'my_page' }
511 507 )
512 508 assert_routing(
513 509 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
514 510 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
515 511 :id => 'ladida' }
516 512 )
517 513 end
518 514
519 515 def test_wikis_plural_admin_setup
520 516 assert_routing(
521 517 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
522 518 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
523 519 )
524 520 assert_routing(
525 521 { :method => 'post', :path => "/projects/ladida/wiki" },
526 522 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
527 523 )
528 524 assert_routing(
529 525 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
530 526 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
531 527 )
532 528 end
533 529 end
General Comments 0
You need to be logged in to leave comments. Login now