##// END OF EJS Templates
test: route: move auto_completes tests in test_issues_extra_actions to new file...
Toshi MARUYAMA -
r8227:b19ea60b970e
parent child
Show More
@@ -0,0 +1,27
1 # Redmine - project management software
2 # Copyright (C) 2006-2011 Jean-Philippe Lang
3 #
4 # This program is free software; you can redistribute it and/or
5 # modify it under the terms of the GNU General Public License
6 # as published by the Free Software Foundation; either version 2
7 # of the License, or (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
18 require File.expand_path('../../../test_helper', __FILE__)
19
20 class RoutingAutoCompletesTest < ActionController::IntegrationTest
21 def test_auto_completes
22 assert_routing(
23 { :method => 'get', :path => "/issues/auto_complete" },
24 { :controller => 'auto_completes', :action => 'issues' }
25 )
26 end
27 end
@@ -1,657 +1,653
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 { :method => 'get', :path => "/issues/auto_complete" },
119 { :controller => 'auto_completes', :action => 'issues' }
120 )
121 assert_routing(
122 118 { :method => 'get', :path => "/issues/preview/123" },
123 119 { :controller => 'previews', :action => 'issue', :id => '123' }
124 120 )
125 121 assert_routing(
126 122 { :method => 'post', :path => "/issues/preview/123" },
127 123 { :controller => 'previews', :action => 'issue', :id => '123' }
128 124 )
129 125 assert_routing(
130 126 { :method => 'get', :path => "/issues/context_menu" },
131 127 { :controller => 'context_menus', :action => 'issues' }
132 128 )
133 129 assert_routing(
134 130 { :method => 'post', :path => "/issues/context_menu" },
135 131 { :controller => 'context_menus', :action => 'issues' }
136 132 )
137 133 assert_routing(
138 134 { :method => 'get', :path => "/issues/bulk_edit" },
139 135 { :controller => 'issues', :action => 'bulk_edit' }
140 136 )
141 137 assert_routing(
142 138 { :method => 'post', :path => "/issues/bulk_update" },
143 139 { :controller => 'issues', :action => 'bulk_update' }
144 140 )
145 141 end
146 142
147 143 def test_issue_categories
148 144 assert_routing(
149 145 { :method => 'get', :path => "/projects/foo/issue_categories" },
150 146 { :controller => 'issue_categories', :action => 'index',
151 147 :project_id => 'foo' }
152 148 )
153 149 assert_routing(
154 150 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
155 151 { :controller => 'issue_categories', :action => 'index',
156 152 :project_id => 'foo', :format => 'xml' }
157 153 )
158 154 assert_routing(
159 155 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
160 156 { :controller => 'issue_categories', :action => 'index',
161 157 :project_id => 'foo', :format => 'json' }
162 158 )
163 159 assert_routing(
164 160 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
165 161 { :controller => 'issue_categories', :action => 'new',
166 162 :project_id => 'foo' }
167 163 )
168 164 assert_routing(
169 165 { :method => 'post', :path => "/projects/foo/issue_categories" },
170 166 { :controller => 'issue_categories', :action => 'create',
171 167 :project_id => 'foo' }
172 168 )
173 169 assert_routing(
174 170 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
175 171 { :controller => 'issue_categories', :action => 'create',
176 172 :project_id => 'foo', :format => 'xml' }
177 173 )
178 174 assert_routing(
179 175 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
180 176 { :controller => 'issue_categories', :action => 'create',
181 177 :project_id => 'foo', :format => 'json' }
182 178 )
183 179 assert_routing(
184 180 { :method => 'get', :path => "/issue_categories/1" },
185 181 { :controller => 'issue_categories', :action => 'show', :id => '1' }
186 182 )
187 183 assert_routing(
188 184 { :method => 'get', :path => "/issue_categories/1.xml" },
189 185 { :controller => 'issue_categories', :action => 'show', :id => '1',
190 186 :format => 'xml' }
191 187 )
192 188 assert_routing(
193 189 { :method => 'get', :path => "/issue_categories/1.json" },
194 190 { :controller => 'issue_categories', :action => 'show', :id => '1',
195 191 :format => 'json' }
196 192 )
197 193 assert_routing(
198 194 { :method => 'get', :path => "/issue_categories/1/edit" },
199 195 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
200 196 )
201 197 assert_routing(
202 198 { :method => 'put', :path => "/issue_categories/1" },
203 199 { :controller => 'issue_categories', :action => 'update', :id => '1' }
204 200 )
205 201 assert_routing(
206 202 { :method => 'put', :path => "/issue_categories/1.xml" },
207 203 { :controller => 'issue_categories', :action => 'update', :id => '1',
208 204 :format => 'xml' }
209 205 )
210 206 assert_routing(
211 207 { :method => 'put', :path => "/issue_categories/1.json" },
212 208 { :controller => 'issue_categories', :action => 'update', :id => '1',
213 209 :format => 'json' }
214 210 )
215 211 assert_routing(
216 212 { :method => 'delete', :path => "/issue_categories/1" },
217 213 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
218 214 )
219 215 assert_routing(
220 216 { :method => 'delete', :path => "/issue_categories/1.xml" },
221 217 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
222 218 :format => 'xml' }
223 219 )
224 220 assert_routing(
225 221 { :method => 'delete', :path => "/issue_categories/1.json" },
226 222 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
227 223 :format => 'json' }
228 224 )
229 225 end
230 226
231 227 def test_news
232 228 assert_routing(
233 229 { :method => 'get', :path => "/news" },
234 230 { :controller => 'news', :action => 'index' }
235 231 )
236 232 assert_routing(
237 233 { :method => 'get', :path => "/news.atom" },
238 234 { :controller => 'news', :action => 'index', :format => 'atom' }
239 235 )
240 236 assert_routing(
241 237 { :method => 'get', :path => "/news.xml" },
242 238 { :controller => 'news', :action => 'index', :format => 'xml' }
243 239 )
244 240 assert_routing(
245 241 { :method => 'get', :path => "/news.json" },
246 242 { :controller => 'news', :action => 'index', :format => 'json' }
247 243 )
248 244 assert_routing(
249 245 { :method => 'get', :path => "/projects/567/news" },
250 246 { :controller => 'news', :action => 'index', :project_id => '567' }
251 247 )
252 248 assert_routing(
253 249 { :method => 'get', :path => "/projects/567/news.atom" },
254 250 { :controller => 'news', :action => 'index', :format => 'atom',
255 251 :project_id => '567' }
256 252 )
257 253 assert_routing(
258 254 { :method => 'get', :path => "/projects/567/news.xml" },
259 255 { :controller => 'news', :action => 'index', :format => 'xml',
260 256 :project_id => '567' }
261 257 )
262 258 assert_routing(
263 259 { :method => 'get', :path => "/projects/567/news.json" },
264 260 { :controller => 'news', :action => 'index', :format => 'json',
265 261 :project_id => '567' }
266 262 )
267 263 assert_routing(
268 264 { :method => 'get', :path => "/news/2" },
269 265 { :controller => 'news', :action => 'show', :id => '2' }
270 266 )
271 267 assert_routing(
272 268 { :method => 'get', :path => "/projects/567/news/new" },
273 269 { :controller => 'news', :action => 'new', :project_id => '567' }
274 270 )
275 271 assert_routing(
276 272 { :method => 'get', :path => "/news/234" },
277 273 { :controller => 'news', :action => 'show', :id => '234' }
278 274 )
279 275 assert_routing(
280 276 { :method => 'get', :path => "/news/567/edit" },
281 277 { :controller => 'news', :action => 'edit', :id => '567' }
282 278 )
283 279 assert_routing(
284 280 { :method => 'get', :path => "/news/preview" },
285 281 { :controller => 'previews', :action => 'news' }
286 282 )
287 283 assert_routing(
288 284 { :method => 'post', :path => "/projects/567/news" },
289 285 { :controller => 'news', :action => 'create', :project_id => '567' }
290 286 )
291 287 assert_routing(
292 288 { :method => 'post', :path => "/news/567/comments" },
293 289 { :controller => 'comments', :action => 'create', :id => '567' }
294 290 )
295 291 assert_routing(
296 292 { :method => 'put', :path => "/news/567" },
297 293 { :controller => 'news', :action => 'update', :id => '567' }
298 294 )
299 295 assert_routing(
300 296 { :method => 'delete', :path => "/news/567" },
301 297 { :controller => 'news', :action => 'destroy', :id => '567' }
302 298 )
303 299 assert_routing(
304 300 { :method => 'delete', :path => "/news/567/comments/15" },
305 301 { :controller => 'comments', :action => 'destroy', :id => '567',
306 302 :comment_id => '15' }
307 303 )
308 304 end
309 305
310 306 def test_projects
311 307 assert_routing(
312 308 { :method => 'get', :path => "/projects" },
313 309 { :controller => 'projects', :action => 'index' }
314 310 )
315 311 assert_routing(
316 312 { :method => 'get', :path => "/projects.atom" },
317 313 { :controller => 'projects', :action => 'index', :format => 'atom' }
318 314 )
319 315 assert_routing(
320 316 { :method => 'get', :path => "/projects.xml" },
321 317 { :controller => 'projects', :action => 'index', :format => 'xml' }
322 318 )
323 319 assert_routing(
324 320 { :method => 'get', :path => "/projects/new" },
325 321 { :controller => 'projects', :action => 'new' }
326 322 )
327 323 assert_routing(
328 324 { :method => 'get', :path => "/projects/test" },
329 325 { :controller => 'projects', :action => 'show', :id => 'test' }
330 326 )
331 327 assert_routing(
332 328 { :method => 'get', :path => "/projects/1.xml" },
333 329 { :controller => 'projects', :action => 'show', :id => '1',
334 330 :format => 'xml' }
335 331 )
336 332 assert_routing(
337 333 { :method => 'get', :path => "/projects/4223/settings" },
338 334 { :controller => 'projects', :action => 'settings', :id => '4223' }
339 335 )
340 336 assert_routing(
341 337 { :method => 'get', :path => "/projects/4223/settings/members" },
342 338 { :controller => 'projects', :action => 'settings', :id => '4223',
343 339 :tab => 'members' }
344 340 )
345 341 assert_routing(
346 342 { :method => 'get', :path => "/projects/33/roadmap" },
347 343 { :controller => 'versions', :action => 'index', :project_id => '33' }
348 344 )
349 345 assert_routing(
350 346 { :method => 'post', :path => "/projects" },
351 347 { :controller => 'projects', :action => 'create' }
352 348 )
353 349 assert_routing(
354 350 { :method => 'post', :path => "/projects.xml" },
355 351 { :controller => 'projects', :action => 'create', :format => 'xml' }
356 352 )
357 353 assert_routing(
358 354 { :method => 'post', :path => "/projects/64/archive" },
359 355 { :controller => 'projects', :action => 'archive', :id => '64' }
360 356 )
361 357 assert_routing(
362 358 { :method => 'post', :path => "/projects/64/unarchive" },
363 359 { :controller => 'projects', :action => 'unarchive', :id => '64' }
364 360 )
365 361 assert_routing(
366 362 { :method => 'put', :path => "/projects/64/enumerations" },
367 363 { :controller => 'project_enumerations', :action => 'update',
368 364 :project_id => '64' }
369 365 )
370 366 assert_routing(
371 367 { :method => 'put', :path => "/projects/4223" },
372 368 { :controller => 'projects', :action => 'update', :id => '4223' }
373 369 )
374 370 assert_routing(
375 371 { :method => 'put', :path => "/projects/1.xml" },
376 372 { :controller => 'projects', :action => 'update', :id => '1',
377 373 :format => 'xml' }
378 374 )
379 375 assert_routing(
380 376 { :method => 'delete', :path => "/projects/64" },
381 377 { :controller => 'projects', :action => 'destroy', :id => '64' }
382 378 )
383 379 assert_routing(
384 380 { :method => 'delete', :path => "/projects/1.xml" },
385 381 { :controller => 'projects', :action => 'destroy', :id => '1',
386 382 :format => 'xml' }
387 383 )
388 384 assert_routing(
389 385 { :method => 'delete', :path => "/projects/64/enumerations" },
390 386 { :controller => 'project_enumerations', :action => 'destroy',
391 387 :project_id => '64' }
392 388 )
393 389 end
394 390
395 391 def test_queries
396 392 assert_routing(
397 393 { :method => 'get', :path => "/queries.xml" },
398 394 { :controller => 'queries', :action => 'index', :format => 'xml' }
399 395 )
400 396 assert_routing(
401 397 { :method => 'get', :path => "/queries.json" },
402 398 { :controller => 'queries', :action => 'index', :format => 'json' }
403 399 )
404 400 assert_routing(
405 401 { :method => 'get', :path => "/queries/new" },
406 402 { :controller => 'queries', :action => 'new' }
407 403 )
408 404 assert_routing(
409 405 { :method => 'get', :path => "/projects/redmine/queries/new" },
410 406 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
411 407 )
412 408 assert_routing(
413 409 { :method => 'post', :path => "/queries" },
414 410 { :controller => 'queries', :action => 'create' }
415 411 )
416 412 assert_routing(
417 413 { :method => 'post', :path => "/projects/redmine/queries" },
418 414 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
419 415 )
420 416 assert_routing(
421 417 { :method => 'get', :path => "/queries/1/edit" },
422 418 { :controller => 'queries', :action => 'edit', :id => '1' }
423 419 )
424 420 assert_routing(
425 421 { :method => 'put', :path => "/queries/1" },
426 422 { :controller => 'queries', :action => 'update', :id => '1' }
427 423 )
428 424 assert_routing(
429 425 { :method => 'delete', :path => "/queries/1" },
430 426 { :controller => 'queries', :action => 'destroy', :id => '1' }
431 427 )
432 428 end
433 429
434 430 def test_roles
435 431 assert_routing(
436 432 { :method => 'get', :path => "/roles" },
437 433 { :controller => 'roles', :action => 'index' }
438 434 )
439 435 assert_routing(
440 436 { :method => 'get', :path => "/roles/new" },
441 437 { :controller => 'roles', :action => 'new' }
442 438 )
443 439 assert_routing(
444 440 { :method => 'post', :path => "/roles" },
445 441 { :controller => 'roles', :action => 'create' }
446 442 )
447 443 assert_routing(
448 444 { :method => 'get', :path => "/roles/2/edit" },
449 445 { :controller => 'roles', :action => 'edit', :id => '2' }
450 446 )
451 447 assert_routing(
452 448 { :method => 'put', :path => "/roles/2" },
453 449 { :controller => 'roles', :action => 'update', :id => '2' }
454 450 )
455 451 assert_routing(
456 452 { :method => 'delete', :path => "/roles/2" },
457 453 { :controller => 'roles', :action => 'destroy', :id => '2' }
458 454 )
459 455 assert_routing(
460 456 { :method => 'get', :path => "/roles/permissions" },
461 457 { :controller => 'roles', :action => 'permissions' }
462 458 )
463 459 assert_routing(
464 460 { :method => 'post', :path => "/roles/permissions" },
465 461 { :controller => 'roles', :action => 'permissions' }
466 462 )
467 463 end
468 464
469 465 def test_users
470 466 assert_routing(
471 467 { :method => 'get', :path => "/users" },
472 468 { :controller => 'users', :action => 'index' }
473 469 )
474 470 assert_routing(
475 471 { :method => 'get', :path => "/users.xml" },
476 472 { :controller => 'users', :action => 'index', :format => 'xml' }
477 473 )
478 474 assert_routing(
479 475 { :method => 'get', :path => "/users/44" },
480 476 { :controller => 'users', :action => 'show', :id => '44' }
481 477 )
482 478 assert_routing(
483 479 { :method => 'get', :path => "/users/44.xml" },
484 480 { :controller => 'users', :action => 'show', :id => '44',
485 481 :format => 'xml' }
486 482 )
487 483 assert_routing(
488 484 { :method => 'get', :path => "/users/current" },
489 485 { :controller => 'users', :action => 'show', :id => 'current' }
490 486 )
491 487 assert_routing(
492 488 { :method => 'get', :path => "/users/current.xml" },
493 489 { :controller => 'users', :action => 'show', :id => 'current',
494 490 :format => 'xml' }
495 491 )
496 492 assert_routing(
497 493 { :method => 'get', :path => "/users/new" },
498 494 { :controller => 'users', :action => 'new' }
499 495 )
500 496 assert_routing(
501 497 { :method => 'get', :path => "/users/444/edit" },
502 498 { :controller => 'users', :action => 'edit', :id => '444' }
503 499 )
504 500 assert_routing(
505 501 { :method => 'post', :path => "/users" },
506 502 { :controller => 'users', :action => 'create' }
507 503 )
508 504 assert_routing(
509 505 { :method => 'post', :path => "/users.xml" },
510 506 { :controller => 'users', :action => 'create', :format => 'xml' }
511 507 )
512 508 assert_routing(
513 509 { :method => 'put', :path => "/users/444" },
514 510 { :controller => 'users', :action => 'update', :id => '444' }
515 511 )
516 512 assert_routing(
517 513 { :method => 'put', :path => "/users/444.xml" },
518 514 { :controller => 'users', :action => 'update', :id => '444',
519 515 :format => 'xml' }
520 516 )
521 517 assert_routing(
522 518 { :method => 'delete', :path => "/users/44" },
523 519 { :controller => 'users', :action => 'destroy', :id => '44' }
524 520 )
525 521 assert_routing(
526 522 { :method => 'delete', :path => "/users/44.xml" },
527 523 { :controller => 'users', :action => 'destroy', :id => '44',
528 524 :format => 'xml' }
529 525 )
530 526 assert_routing(
531 527 { :method => 'post', :path => "/users/123/memberships" },
532 528 { :controller => 'users', :action => 'edit_membership',
533 529 :id => '123' }
534 530 )
535 531 assert_routing(
536 532 { :method => 'put', :path => "/users/123/memberships/55" },
537 533 { :controller => 'users', :action => 'edit_membership',
538 534 :id => '123', :membership_id => '55' }
539 535 )
540 536 assert_routing(
541 537 { :method => 'delete', :path => "/users/123/memberships/55" },
542 538 { :controller => 'users', :action => 'destroy_membership',
543 539 :id => '123', :membership_id => '55' }
544 540 )
545 541 end
546 542
547 543 def test_welcome
548 544 assert_routing(
549 545 { :method => 'get', :path => "/robots.txt" },
550 546 { :controller => 'welcome', :action => 'robots' }
551 547 )
552 548 end
553 549
554 550 def test_wiki_singular_projects_pages
555 551 assert_routing(
556 552 { :method => 'get', :path => "/projects/567/wiki" },
557 553 { :controller => 'wiki', :action => 'show', :project_id => '567' }
558 554 )
559 555 assert_routing(
560 556 { :method => 'get', :path => "/projects/567/wiki/lalala" },
561 557 { :controller => 'wiki', :action => 'show', :project_id => '567',
562 558 :id => 'lalala' }
563 559 )
564 560 assert_routing(
565 561 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
566 562 { :controller => 'wiki', :action => 'edit', :project_id => '567',
567 563 :id => 'my_page' }
568 564 )
569 565 assert_routing(
570 566 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
571 567 { :controller => 'wiki', :action => 'history', :project_id => '1',
572 568 :id => 'CookBook_documentation' }
573 569 )
574 570 assert_routing(
575 571 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
576 572 { :controller => 'wiki', :action => 'diff', :project_id => '1',
577 573 :id => 'CookBook_documentation' }
578 574 )
579 575 assert_routing(
580 576 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
581 577 { :controller => 'wiki', :action => 'diff', :project_id => '1',
582 578 :id => 'CookBook_documentation', :version => '2' }
583 579 )
584 580 assert_routing(
585 581 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
586 582 { :controller => 'wiki', :action => 'diff', :project_id => '1',
587 583 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
588 584 )
589 585 assert_routing(
590 586 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
591 587 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
592 588 :id => 'CookBook_documentation', :version => '2' }
593 589 )
594 590 assert_routing(
595 591 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
596 592 { :controller => 'wiki', :action => 'rename', :project_id => '22',
597 593 :id => 'ladida' }
598 594 )
599 595 assert_routing(
600 596 { :method => 'get', :path => "/projects/567/wiki/index" },
601 597 { :controller => 'wiki', :action => 'index', :project_id => '567' }
602 598 )
603 599 assert_routing(
604 600 { :method => 'get', :path => "/projects/567/wiki/date_index" },
605 601 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
606 602 )
607 603 assert_routing(
608 604 { :method => 'get', :path => "/projects/567/wiki/export" },
609 605 { :controller => 'wiki', :action => 'export', :project_id => '567' }
610 606 )
611 607 assert_routing(
612 608 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
613 609 { :controller => 'wiki', :action => 'preview', :project_id => '567',
614 610 :id => 'CookBook_documentation' }
615 611 )
616 612 assert_routing(
617 613 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
618 614 { :controller => 'wiki', :action => 'rename', :project_id => '22',
619 615 :id => 'ladida' }
620 616 )
621 617 assert_routing(
622 618 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
623 619 { :controller => 'wiki', :action => 'protect', :project_id => '22',
624 620 :id => 'ladida' }
625 621 )
626 622 assert_routing(
627 623 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
628 624 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
629 625 :id => 'ladida' }
630 626 )
631 627 assert_routing(
632 628 { :method => 'put', :path => "/projects/567/wiki/my_page" },
633 629 { :controller => 'wiki', :action => 'update', :project_id => '567',
634 630 :id => 'my_page' }
635 631 )
636 632 assert_routing(
637 633 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
638 634 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
639 635 :id => 'ladida' }
640 636 )
641 637 end
642 638
643 639 def test_wikis_plural_admin_setup
644 640 assert_routing(
645 641 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
646 642 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
647 643 )
648 644 assert_routing(
649 645 { :method => 'post', :path => "/projects/ladida/wiki" },
650 646 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
651 647 )
652 648 assert_routing(
653 649 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
654 650 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
655 651 )
656 652 end
657 653 end
General Comments 0
You need to be logged in to leave comments. Login now