##// END OF EJS Templates
test: route: move calendars test in test_issues_extra_actions to new file...
Toshi MARUYAMA -
r8214:f37ee781fb9a
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 RoutingCalendarsTest < ActionController::IntegrationTest
21 def test_calendars
22 assert_routing(
23 { :method => 'get', :path => "/issues/calendar" },
24 { :controller => 'calendars', :action => 'show' }
25 )
26 end
27 end
@@ -1,1163 +1,1159
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/calendar" },
119 { :controller => 'calendars', :action => 'show' }
120 )
121 assert_routing(
122 118 { :method => 'get', :path => "/projects/project-name/issues/calendar" },
123 119 { :controller => 'calendars', :action => 'show',
124 120 :project_id => 'project-name' }
125 121 )
126 122 assert_routing(
127 123 { :method => 'get', :path => "/issues/gantt" },
128 124 { :controller => 'gantts', :action => 'show' }
129 125 )
130 126 assert_routing(
131 127 { :method => 'get', :path => "/issues/gantt.pdf" },
132 128 { :controller => 'gantts', :action => 'show', :format => 'pdf' }
133 129 )
134 130 assert_routing(
135 131 { :method => 'get', :path => "/projects/project-name/issues/gantt" },
136 132 { :controller => 'gantts', :action => 'show',
137 133 :project_id => 'project-name' }
138 134 )
139 135 assert_routing(
140 136 { :method => 'get', :path => "/projects/project-name/issues/gantt.pdf" },
141 137 { :controller => 'gantts', :action => 'show',
142 138 :project_id => 'project-name', :format => 'pdf' }
143 139 )
144 140 assert_routing(
145 141 { :method => 'get', :path => "/issues/auto_complete" },
146 142 { :controller => 'auto_completes', :action => 'issues' }
147 143 )
148 144 assert_routing(
149 145 { :method => 'get', :path => "/issues/preview/123" },
150 146 { :controller => 'previews', :action => 'issue', :id => '123' }
151 147 )
152 148 assert_routing(
153 149 { :method => 'post', :path => "/issues/preview/123" },
154 150 { :controller => 'previews', :action => 'issue', :id => '123' }
155 151 )
156 152 assert_routing(
157 153 { :method => 'get', :path => "/issues/context_menu" },
158 154 { :controller => 'context_menus', :action => 'issues' }
159 155 )
160 156 assert_routing(
161 157 { :method => 'post', :path => "/issues/context_menu" },
162 158 { :controller => 'context_menus', :action => 'issues' }
163 159 )
164 160 assert_routing(
165 161 { :method => 'get', :path => "/issues/bulk_edit" },
166 162 { :controller => 'issues', :action => 'bulk_edit' }
167 163 )
168 164 assert_routing(
169 165 { :method => 'post', :path => "/issues/bulk_update" },
170 166 { :controller => 'issues', :action => 'bulk_update' }
171 167 )
172 168 end
173 169
174 170 def test_issue_categories
175 171 assert_routing(
176 172 { :method => 'get', :path => "/projects/foo/issue_categories" },
177 173 { :controller => 'issue_categories', :action => 'index',
178 174 :project_id => 'foo' }
179 175 )
180 176 assert_routing(
181 177 { :method => 'get', :path => "/projects/foo/issue_categories.xml" },
182 178 { :controller => 'issue_categories', :action => 'index',
183 179 :project_id => 'foo', :format => 'xml' }
184 180 )
185 181 assert_routing(
186 182 { :method => 'get', :path => "/projects/foo/issue_categories.json" },
187 183 { :controller => 'issue_categories', :action => 'index',
188 184 :project_id => 'foo', :format => 'json' }
189 185 )
190 186 assert_routing(
191 187 { :method => 'get', :path => "/projects/foo/issue_categories/new" },
192 188 { :controller => 'issue_categories', :action => 'new',
193 189 :project_id => 'foo' }
194 190 )
195 191 assert_routing(
196 192 { :method => 'post', :path => "/projects/foo/issue_categories" },
197 193 { :controller => 'issue_categories', :action => 'create',
198 194 :project_id => 'foo' }
199 195 )
200 196 assert_routing(
201 197 { :method => 'post', :path => "/projects/foo/issue_categories.xml" },
202 198 { :controller => 'issue_categories', :action => 'create',
203 199 :project_id => 'foo', :format => 'xml' }
204 200 )
205 201 assert_routing(
206 202 { :method => 'post', :path => "/projects/foo/issue_categories.json" },
207 203 { :controller => 'issue_categories', :action => 'create',
208 204 :project_id => 'foo', :format => 'json' }
209 205 )
210 206 assert_routing(
211 207 { :method => 'get', :path => "/issue_categories/1" },
212 208 { :controller => 'issue_categories', :action => 'show', :id => '1' }
213 209 )
214 210 assert_routing(
215 211 { :method => 'get', :path => "/issue_categories/1.xml" },
216 212 { :controller => 'issue_categories', :action => 'show', :id => '1',
217 213 :format => 'xml' }
218 214 )
219 215 assert_routing(
220 216 { :method => 'get', :path => "/issue_categories/1.json" },
221 217 { :controller => 'issue_categories', :action => 'show', :id => '1',
222 218 :format => 'json' }
223 219 )
224 220 assert_routing(
225 221 { :method => 'get', :path => "/issue_categories/1/edit" },
226 222 { :controller => 'issue_categories', :action => 'edit', :id => '1' }
227 223 )
228 224 assert_routing(
229 225 { :method => 'put', :path => "/issue_categories/1" },
230 226 { :controller => 'issue_categories', :action => 'update', :id => '1' }
231 227 )
232 228 assert_routing(
233 229 { :method => 'put', :path => "/issue_categories/1.xml" },
234 230 { :controller => 'issue_categories', :action => 'update', :id => '1',
235 231 :format => 'xml' }
236 232 )
237 233 assert_routing(
238 234 { :method => 'put', :path => "/issue_categories/1.json" },
239 235 { :controller => 'issue_categories', :action => 'update', :id => '1',
240 236 :format => 'json' }
241 237 )
242 238 assert_routing(
243 239 { :method => 'delete', :path => "/issue_categories/1" },
244 240 { :controller => 'issue_categories', :action => 'destroy', :id => '1' }
245 241 )
246 242 assert_routing(
247 243 { :method => 'delete', :path => "/issue_categories/1.xml" },
248 244 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
249 245 :format => 'xml' }
250 246 )
251 247 assert_routing(
252 248 { :method => 'delete', :path => "/issue_categories/1.json" },
253 249 { :controller => 'issue_categories', :action => 'destroy', :id => '1',
254 250 :format => 'json' }
255 251 )
256 252 end
257 253
258 254 def test_issue_relations
259 255 assert_routing(
260 256 { :method => 'get', :path => "/issues/1/relations" },
261 257 { :controller => 'issue_relations', :action => 'index',
262 258 :issue_id => '1' }
263 259 )
264 260 assert_routing(
265 261 { :method => 'get', :path => "/issues/1/relations.xml" },
266 262 { :controller => 'issue_relations', :action => 'index',
267 263 :issue_id => '1', :format => 'xml' }
268 264 )
269 265 assert_routing(
270 266 { :method => 'get', :path => "/issues/1/relations.json" },
271 267 { :controller => 'issue_relations', :action => 'index',
272 268 :issue_id => '1', :format => 'json' }
273 269 )
274 270 assert_routing(
275 271 { :method => 'post', :path => "/issues/1/relations" },
276 272 { :controller => 'issue_relations', :action => 'create',
277 273 :issue_id => '1' }
278 274 )
279 275 assert_routing(
280 276 { :method => 'post', :path => "/issues/1/relations.xml" },
281 277 { :controller => 'issue_relations', :action => 'create',
282 278 :issue_id => '1', :format => 'xml' }
283 279 )
284 280 assert_routing(
285 281 { :method => 'post', :path => "/issues/1/relations.json" },
286 282 { :controller => 'issue_relations', :action => 'create',
287 283 :issue_id => '1', :format => 'json' }
288 284 )
289 285 assert_routing(
290 286 { :method => 'get', :path => "/relations/23" },
291 287 { :controller => 'issue_relations', :action => 'show', :id => '23' }
292 288 )
293 289 assert_routing(
294 290 { :method => 'get', :path => "/relations/23.xml" },
295 291 { :controller => 'issue_relations', :action => 'show', :id => '23',
296 292 :format => 'xml' }
297 293 )
298 294 assert_routing(
299 295 { :method => 'get', :path => "/relations/23.json" },
300 296 { :controller => 'issue_relations', :action => 'show', :id => '23',
301 297 :format => 'json' }
302 298 )
303 299 assert_routing(
304 300 { :method => 'delete', :path => "/relations/23" },
305 301 { :controller => 'issue_relations', :action => 'destroy', :id => '23' }
306 302 )
307 303 assert_routing(
308 304 { :method => 'delete', :path => "/relations/23.xml" },
309 305 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
310 306 :format => 'xml' }
311 307 )
312 308 assert_routing(
313 309 { :method => 'delete', :path => "/relations/23.json" },
314 310 { :controller => 'issue_relations', :action => 'destroy', :id => '23',
315 311 :format => 'json' }
316 312 )
317 313 end
318 314
319 315 def test_issue_reports
320 316 assert_routing(
321 317 { :method => 'get', :path => "/projects/567/issues/report" },
322 318 { :controller => 'reports', :action => 'issue_report', :id => '567' }
323 319 )
324 320 assert_routing(
325 321 { :method => 'get', :path => "/projects/567/issues/report/assigned_to" },
326 322 { :controller => 'reports', :action => 'issue_report_details',
327 323 :id => '567', :detail => 'assigned_to' }
328 324 )
329 325 end
330 326
331 327 def test_members
332 328 assert_routing(
333 329 { :method => 'post', :path => "/projects/5234/members/new" },
334 330 { :controller => 'members', :action => 'new', :id => '5234' }
335 331 )
336 332 end
337 333
338 334 def test_news
339 335 assert_routing(
340 336 { :method => 'get', :path => "/news" },
341 337 { :controller => 'news', :action => 'index' }
342 338 )
343 339 assert_routing(
344 340 { :method => 'get', :path => "/news.atom" },
345 341 { :controller => 'news', :action => 'index', :format => 'atom' }
346 342 )
347 343 assert_routing(
348 344 { :method => 'get', :path => "/news.xml" },
349 345 { :controller => 'news', :action => 'index', :format => 'xml' }
350 346 )
351 347 assert_routing(
352 348 { :method => 'get', :path => "/news.json" },
353 349 { :controller => 'news', :action => 'index', :format => 'json' }
354 350 )
355 351 assert_routing(
356 352 { :method => 'get', :path => "/projects/567/news" },
357 353 { :controller => 'news', :action => 'index', :project_id => '567' }
358 354 )
359 355 assert_routing(
360 356 { :method => 'get', :path => "/projects/567/news.atom" },
361 357 { :controller => 'news', :action => 'index', :format => 'atom',
362 358 :project_id => '567' }
363 359 )
364 360 assert_routing(
365 361 { :method => 'get', :path => "/projects/567/news.xml" },
366 362 { :controller => 'news', :action => 'index', :format => 'xml',
367 363 :project_id => '567' }
368 364 )
369 365 assert_routing(
370 366 { :method => 'get', :path => "/projects/567/news.json" },
371 367 { :controller => 'news', :action => 'index', :format => 'json',
372 368 :project_id => '567' }
373 369 )
374 370 assert_routing(
375 371 { :method => 'get', :path => "/news/2" },
376 372 { :controller => 'news', :action => 'show', :id => '2' }
377 373 )
378 374 assert_routing(
379 375 { :method => 'get', :path => "/projects/567/news/new" },
380 376 { :controller => 'news', :action => 'new', :project_id => '567' }
381 377 )
382 378 assert_routing(
383 379 { :method => 'get', :path => "/news/234" },
384 380 { :controller => 'news', :action => 'show', :id => '234' }
385 381 )
386 382 assert_routing(
387 383 { :method => 'get', :path => "/news/567/edit" },
388 384 { :controller => 'news', :action => 'edit', :id => '567' }
389 385 )
390 386 assert_routing(
391 387 { :method => 'get', :path => "/news/preview" },
392 388 { :controller => 'previews', :action => 'news' }
393 389 )
394 390 assert_routing(
395 391 { :method => 'post', :path => "/projects/567/news" },
396 392 { :controller => 'news', :action => 'create', :project_id => '567' }
397 393 )
398 394 assert_routing(
399 395 { :method => 'post', :path => "/news/567/comments" },
400 396 { :controller => 'comments', :action => 'create', :id => '567' }
401 397 )
402 398 assert_routing(
403 399 { :method => 'put', :path => "/news/567" },
404 400 { :controller => 'news', :action => 'update', :id => '567' }
405 401 )
406 402 assert_routing(
407 403 { :method => 'delete', :path => "/news/567" },
408 404 { :controller => 'news', :action => 'destroy', :id => '567' }
409 405 )
410 406 assert_routing(
411 407 { :method => 'delete', :path => "/news/567/comments/15" },
412 408 { :controller => 'comments', :action => 'destroy', :id => '567',
413 409 :comment_id => '15' }
414 410 )
415 411 end
416 412
417 413 def test_projects
418 414 assert_routing(
419 415 { :method => 'get', :path => "/projects" },
420 416 { :controller => 'projects', :action => 'index' }
421 417 )
422 418 assert_routing(
423 419 { :method => 'get', :path => "/projects.atom" },
424 420 { :controller => 'projects', :action => 'index', :format => 'atom' }
425 421 )
426 422 assert_routing(
427 423 { :method => 'get', :path => "/projects.xml" },
428 424 { :controller => 'projects', :action => 'index', :format => 'xml' }
429 425 )
430 426 assert_routing(
431 427 { :method => 'get', :path => "/projects/new" },
432 428 { :controller => 'projects', :action => 'new' }
433 429 )
434 430 assert_routing(
435 431 { :method => 'get', :path => "/projects/test" },
436 432 { :controller => 'projects', :action => 'show', :id => 'test' }
437 433 )
438 434 assert_routing(
439 435 { :method => 'get', :path => "/projects/1.xml" },
440 436 { :controller => 'projects', :action => 'show', :id => '1',
441 437 :format => 'xml' }
442 438 )
443 439 assert_routing(
444 440 { :method => 'get', :path => "/projects/4223/settings" },
445 441 { :controller => 'projects', :action => 'settings', :id => '4223' }
446 442 )
447 443 assert_routing(
448 444 { :method => 'get', :path => "/projects/4223/settings/members" },
449 445 { :controller => 'projects', :action => 'settings', :id => '4223',
450 446 :tab => 'members' }
451 447 )
452 448 assert_routing(
453 449 { :method => 'get', :path => "/projects/33/files" },
454 450 { :controller => 'files', :action => 'index', :project_id => '33' }
455 451 )
456 452 assert_routing(
457 453 { :method => 'get', :path => "/projects/33/files/new" },
458 454 { :controller => 'files', :action => 'new', :project_id => '33' }
459 455 )
460 456 assert_routing(
461 457 { :method => 'get', :path => "/projects/33/roadmap" },
462 458 { :controller => 'versions', :action => 'index', :project_id => '33' }
463 459 )
464 460 assert_routing(
465 461 { :method => 'get', :path => "/projects/33/activity" },
466 462 { :controller => 'activities', :action => 'index', :id => '33' }
467 463 )
468 464 assert_routing(
469 465 { :method => 'get', :path => "/projects/33/activity.atom" },
470 466 { :controller => 'activities', :action => 'index', :id => '33',
471 467 :format => 'atom' }
472 468 )
473 469 assert_routing(
474 470 { :method => 'post', :path => "/projects" },
475 471 { :controller => 'projects', :action => 'create' }
476 472 )
477 473 assert_routing(
478 474 { :method => 'post', :path => "/projects.xml" },
479 475 { :controller => 'projects', :action => 'create', :format => 'xml' }
480 476 )
481 477 assert_routing(
482 478 { :method => 'post', :path => "/projects/33/files" },
483 479 { :controller => 'files', :action => 'create', :project_id => '33' }
484 480 )
485 481 assert_routing(
486 482 { :method => 'post', :path => "/projects/64/archive" },
487 483 { :controller => 'projects', :action => 'archive', :id => '64' }
488 484 )
489 485 assert_routing(
490 486 { :method => 'post', :path => "/projects/64/unarchive" },
491 487 { :controller => 'projects', :action => 'unarchive', :id => '64' }
492 488 )
493 489 assert_routing(
494 490 { :method => 'put', :path => "/projects/64/enumerations" },
495 491 { :controller => 'project_enumerations', :action => 'update',
496 492 :project_id => '64' }
497 493 )
498 494 assert_routing(
499 495 { :method => 'put', :path => "/projects/4223" },
500 496 { :controller => 'projects', :action => 'update', :id => '4223' }
501 497 )
502 498 assert_routing(
503 499 { :method => 'put', :path => "/projects/1.xml" },
504 500 { :controller => 'projects', :action => 'update', :id => '1',
505 501 :format => 'xml' }
506 502 )
507 503 assert_routing(
508 504 { :method => 'delete', :path => "/projects/64" },
509 505 { :controller => 'projects', :action => 'destroy', :id => '64' }
510 506 )
511 507 assert_routing(
512 508 { :method => 'delete', :path => "/projects/1.xml" },
513 509 { :controller => 'projects', :action => 'destroy', :id => '1',
514 510 :format => 'xml' }
515 511 )
516 512 assert_routing(
517 513 { :method => 'delete', :path => "/projects/64/enumerations" },
518 514 { :controller => 'project_enumerations', :action => 'destroy',
519 515 :project_id => '64' }
520 516 )
521 517 end
522 518
523 519 def test_queries
524 520 assert_routing(
525 521 { :method => 'get', :path => "/queries.xml" },
526 522 { :controller => 'queries', :action => 'index', :format => 'xml' }
527 523 )
528 524 assert_routing(
529 525 { :method => 'get', :path => "/queries.json" },
530 526 { :controller => 'queries', :action => 'index', :format => 'json' }
531 527 )
532 528 assert_routing(
533 529 { :method => 'get', :path => "/queries/new" },
534 530 { :controller => 'queries', :action => 'new' }
535 531 )
536 532 assert_routing(
537 533 { :method => 'get', :path => "/projects/redmine/queries/new" },
538 534 { :controller => 'queries', :action => 'new', :project_id => 'redmine' }
539 535 )
540 536 assert_routing(
541 537 { :method => 'post', :path => "/queries" },
542 538 { :controller => 'queries', :action => 'create' }
543 539 )
544 540 assert_routing(
545 541 { :method => 'post', :path => "/projects/redmine/queries" },
546 542 { :controller => 'queries', :action => 'create', :project_id => 'redmine' }
547 543 )
548 544 assert_routing(
549 545 { :method => 'get', :path => "/queries/1/edit" },
550 546 { :controller => 'queries', :action => 'edit', :id => '1' }
551 547 )
552 548 assert_routing(
553 549 { :method => 'put', :path => "/queries/1" },
554 550 { :controller => 'queries', :action => 'update', :id => '1' }
555 551 )
556 552 assert_routing(
557 553 { :method => 'delete', :path => "/queries/1" },
558 554 { :controller => 'queries', :action => 'destroy', :id => '1' }
559 555 )
560 556 end
561 557
562 558 def test_repositories
563 559 assert_routing(
564 560 { :method => 'get',
565 561 :path => "/projects/redmine/repository" },
566 562 { :controller => 'repositories', :action => 'show', :id => 'redmine' }
567 563 )
568 564 assert_routing(
569 565 { :method => 'get',
570 566 :path => "/projects/redmine/repository/edit" },
571 567 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
572 568 )
573 569 assert_routing(
574 570 { :method => 'get',
575 571 :path => "/projects/redmine/repository/revisions" },
576 572 { :controller => 'repositories', :action => 'revisions', :id => 'redmine' }
577 573 )
578 574 assert_routing(
579 575 { :method => 'get',
580 576 :path => "/projects/redmine/repository/revisions.atom" },
581 577 { :controller => 'repositories', :action => 'revisions', :id => 'redmine',
582 578 :format => 'atom' }
583 579 )
584 580 assert_routing(
585 581 { :method => 'get',
586 582 :path => "/projects/redmine/repository/revisions/2457" },
587 583 { :controller => 'repositories', :action => 'revision', :id => 'redmine',
588 584 :rev => '2457' }
589 585 )
590 586 assert_routing(
591 587 { :method => 'get',
592 588 :path => "/projects/redmine/repository/revisions/2457/diff" },
593 589 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
594 590 :rev => '2457' }
595 591 )
596 592 assert_routing(
597 593 { :method => 'get',
598 594 :path => "/projects/redmine/repository/revisions/2457/diff.diff" },
599 595 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
600 596 :rev => '2457', :format => 'diff' }
601 597 )
602 598 assert_routing(
603 599 { :method => 'get',
604 600 :path => "/projects/redmine/repository/diff/path/to/file.c" },
605 601 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
606 602 :path => %w[path to file.c] }
607 603 )
608 604 assert_routing(
609 605 { :method => 'get',
610 606 :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" },
611 607 { :controller => 'repositories', :action => 'diff', :id => 'redmine',
612 608 :path => %w[path to file.c], :rev => '2' }
613 609 )
614 610 assert_routing(
615 611 { :method => 'get',
616 612 :path => "/projects/redmine/repository/browse/path/to/file.c" },
617 613 { :controller => 'repositories', :action => 'browse', :id => 'redmine',
618 614 :path => %w[path to file.c] }
619 615 )
620 616 assert_routing(
621 617 { :method => 'get',
622 618 :path => "/projects/redmine/repository/entry/path/to/file.c" },
623 619 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
624 620 :path => %w[path to file.c] }
625 621 )
626 622 assert_routing(
627 623 { :method => 'get',
628 624 :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" },
629 625 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
630 626 :path => %w[path to file.c], :rev => '2' }
631 627 )
632 628 assert_routing(
633 629 { :method => 'get',
634 630 :path => "/projects/redmine/repository/raw/path/to/file.c" },
635 631 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
636 632 :path => %w[path to file.c], :format => 'raw' }
637 633 )
638 634 assert_routing(
639 635 { :method => 'get',
640 636 :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" },
641 637 { :controller => 'repositories', :action => 'entry', :id => 'redmine',
642 638 :path => %w[path to file.c], :rev => '2', :format => 'raw' }
643 639 )
644 640 assert_routing(
645 641 { :method => 'get',
646 642 :path => "/projects/redmine/repository/annotate/path/to/file.c" },
647 643 { :controller => 'repositories', :action => 'annotate', :id => 'redmine',
648 644 :path => %w[path to file.c] }
649 645 )
650 646 assert_routing(
651 647 { :method => 'get',
652 648 :path => "/projects/redmine/repository/changes/path/to/file.c" },
653 649 { :controller => 'repositories', :action => 'changes', :id => 'redmine',
654 650 :path => %w[path to file.c] }
655 651 )
656 652 assert_routing(
657 653 { :method => 'get',
658 654 :path => "/projects/redmine/repository/statistics" },
659 655 { :controller => 'repositories', :action => 'stats', :id => 'redmine' }
660 656 )
661 657 assert_routing(
662 658 { :method => 'post',
663 659 :path => "/projects/redmine/repository/edit" },
664 660 { :controller => 'repositories', :action => 'edit', :id => 'redmine' }
665 661 )
666 662 end
667 663
668 664 def test_roles
669 665 assert_routing(
670 666 { :method => 'get', :path => "/roles" },
671 667 { :controller => 'roles', :action => 'index' }
672 668 )
673 669 assert_routing(
674 670 { :method => 'get', :path => "/roles/new" },
675 671 { :controller => 'roles', :action => 'new' }
676 672 )
677 673 assert_routing(
678 674 { :method => 'post', :path => "/roles" },
679 675 { :controller => 'roles', :action => 'create' }
680 676 )
681 677 assert_routing(
682 678 { :method => 'get', :path => "/roles/2/edit" },
683 679 { :controller => 'roles', :action => 'edit', :id => '2' }
684 680 )
685 681 assert_routing(
686 682 { :method => 'put', :path => "/roles/2" },
687 683 { :controller => 'roles', :action => 'update', :id => '2' }
688 684 )
689 685 assert_routing(
690 686 { :method => 'delete', :path => "/roles/2" },
691 687 { :controller => 'roles', :action => 'destroy', :id => '2' }
692 688 )
693 689 assert_routing(
694 690 { :method => 'get', :path => "/roles/permissions" },
695 691 { :controller => 'roles', :action => 'permissions' }
696 692 )
697 693 assert_routing(
698 694 { :method => 'post', :path => "/roles/permissions" },
699 695 { :controller => 'roles', :action => 'permissions' }
700 696 )
701 697 end
702 698
703 699 def test_timelogs_global
704 700 assert_routing(
705 701 { :method => 'get', :path => "/time_entries" },
706 702 { :controller => 'timelog', :action => 'index' }
707 703 )
708 704 assert_routing(
709 705 { :method => 'get', :path => "/time_entries.csv" },
710 706 { :controller => 'timelog', :action => 'index', :format => 'csv' }
711 707 )
712 708 assert_routing(
713 709 { :method => 'get', :path => "/time_entries.atom" },
714 710 { :controller => 'timelog', :action => 'index', :format => 'atom' }
715 711 )
716 712 assert_routing(
717 713 { :method => 'get', :path => "/time_entries/new" },
718 714 { :controller => 'timelog', :action => 'new' }
719 715 )
720 716 assert_routing(
721 717 { :method => 'get', :path => "/time_entries/22/edit" },
722 718 { :controller => 'timelog', :action => 'edit', :id => '22' }
723 719 )
724 720 assert_routing(
725 721 { :method => 'post', :path => "/time_entries" },
726 722 { :controller => 'timelog', :action => 'create' }
727 723 )
728 724 assert_routing(
729 725 { :method => 'put', :path => "/time_entries/22" },
730 726 { :controller => 'timelog', :action => 'update', :id => '22' }
731 727 )
732 728 assert_routing(
733 729 { :method => 'delete', :path => "/time_entries/55" },
734 730 { :controller => 'timelog', :action => 'destroy', :id => '55' }
735 731 )
736 732 end
737 733
738 734 def test_timelogs_scoped_under_project
739 735 assert_routing(
740 736 { :method => 'get', :path => "/projects/567/time_entries" },
741 737 { :controller => 'timelog', :action => 'index', :project_id => '567' }
742 738 )
743 739 assert_routing(
744 740 { :method => 'get', :path => "/projects/567/time_entries.csv" },
745 741 { :controller => 'timelog', :action => 'index', :project_id => '567',
746 742 :format => 'csv' }
747 743 )
748 744 assert_routing(
749 745 { :method => 'get', :path => "/projects/567/time_entries.atom" },
750 746 { :controller => 'timelog', :action => 'index', :project_id => '567',
751 747 :format => 'atom' }
752 748 )
753 749 assert_routing(
754 750 { :method => 'get', :path => "/projects/567/time_entries/new" },
755 751 { :controller => 'timelog', :action => 'new', :project_id => '567' }
756 752 )
757 753 assert_routing(
758 754 { :method => 'get', :path => "/projects/567/time_entries/22/edit" },
759 755 { :controller => 'timelog', :action => 'edit',
760 756 :id => '22', :project_id => '567' }
761 757 )
762 758 assert_routing(
763 759 { :method => 'post', :path => "/projects/567/time_entries" },
764 760 { :controller => 'timelog', :action => 'create',
765 761 :project_id => '567' }
766 762 )
767 763 assert_routing(
768 764 { :method => 'put', :path => "/projects/567/time_entries/22" },
769 765 { :controller => 'timelog', :action => 'update',
770 766 :id => '22', :project_id => '567' }
771 767 )
772 768 assert_routing(
773 769 { :method => 'delete', :path => "/projects/567/time_entries/55" },
774 770 { :controller => 'timelog', :action => 'destroy',
775 771 :id => '55', :project_id => '567' }
776 772 )
777 773 end
778 774
779 775 def test_timelogs_scoped_under_issues
780 776 assert_routing(
781 777 { :method => 'get', :path => "/issues/234/time_entries" },
782 778 { :controller => 'timelog', :action => 'index', :issue_id => '234' }
783 779 )
784 780 assert_routing(
785 781 { :method => 'get', :path => "/issues/234/time_entries.csv" },
786 782 { :controller => 'timelog', :action => 'index', :issue_id => '234',
787 783 :format => 'csv' }
788 784 )
789 785 assert_routing(
790 786 { :method => 'get', :path => "/issues/234/time_entries.atom" },
791 787 { :controller => 'timelog', :action => 'index', :issue_id => '234',
792 788 :format => 'atom' }
793 789 )
794 790 assert_routing(
795 791 { :method => 'get', :path => "/issues/234/time_entries/new" },
796 792 { :controller => 'timelog', :action => 'new', :issue_id => '234' }
797 793 )
798 794 assert_routing(
799 795 { :method => 'get', :path => "/issues/234/time_entries/22/edit" },
800 796 { :controller => 'timelog', :action => 'edit', :id => '22',
801 797 :issue_id => '234' }
802 798 )
803 799 assert_routing(
804 800 { :method => 'post', :path => "/issues/234/time_entries" },
805 801 { :controller => 'timelog', :action => 'create', :issue_id => '234' }
806 802 )
807 803 assert_routing(
808 804 { :method => 'put', :path => "/issues/234/time_entries/22" },
809 805 { :controller => 'timelog', :action => 'update', :id => '22',
810 806 :issue_id => '234' }
811 807 )
812 808 assert_routing(
813 809 { :method => 'delete', :path => "/issues/234/time_entries/55" },
814 810 { :controller => 'timelog', :action => 'destroy', :id => '55',
815 811 :issue_id => '234' }
816 812 )
817 813 end
818 814
819 815 def test_timelogs_scoped_under_project_and_issues
820 816 assert_routing(
821 817 { :method => 'get',
822 818 :path => "/projects/ecookbook/issues/234/time_entries" },
823 819 { :controller => 'timelog', :action => 'index',
824 820 :issue_id => '234', :project_id => 'ecookbook' }
825 821 )
826 822 assert_routing(
827 823 { :method => 'get',
828 824 :path => "/projects/ecookbook/issues/234/time_entries.csv" },
829 825 { :controller => 'timelog', :action => 'index',
830 826 :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' }
831 827 )
832 828 assert_routing(
833 829 { :method => 'get',
834 830 :path => "/projects/ecookbook/issues/234/time_entries.atom" },
835 831 { :controller => 'timelog', :action => 'index',
836 832 :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' }
837 833 )
838 834 assert_routing(
839 835 { :method => 'get',
840 836 :path => "/projects/ecookbook/issues/234/time_entries/new" },
841 837 { :controller => 'timelog', :action => 'new',
842 838 :issue_id => '234', :project_id => 'ecookbook' }
843 839 )
844 840 assert_routing(
845 841 { :method => 'get',
846 842 :path => "/projects/ecookbook/issues/234/time_entries/22/edit" },
847 843 { :controller => 'timelog', :action => 'edit', :id => '22',
848 844 :issue_id => '234', :project_id => 'ecookbook' }
849 845 )
850 846 assert_routing(
851 847 { :method => 'post',
852 848 :path => "/projects/ecookbook/issues/234/time_entries" },
853 849 { :controller => 'timelog', :action => 'create',
854 850 :issue_id => '234', :project_id => 'ecookbook' }
855 851 )
856 852 assert_routing(
857 853 { :method => 'put',
858 854 :path => "/projects/ecookbook/issues/234/time_entries/22" },
859 855 { :controller => 'timelog', :action => 'update', :id => '22',
860 856 :issue_id => '234', :project_id => 'ecookbook' }
861 857 )
862 858 assert_routing(
863 859 { :method => 'delete',
864 860 :path => "/projects/ecookbook/issues/234/time_entries/55" },
865 861 { :controller => 'timelog', :action => 'destroy', :id => '55',
866 862 :issue_id => '234', :project_id => 'ecookbook' }
867 863 )
868 864 assert_routing(
869 865 { :method => 'get',
870 866 :path => "/time_entries/report" },
871 867 { :controller => 'timelog', :action => 'report' }
872 868 )
873 869 assert_routing(
874 870 { :method => 'get',
875 871 :path => "/projects/567/time_entries/report" },
876 872 { :controller => 'timelog', :action => 'report', :project_id => '567' }
877 873 )
878 874 assert_routing(
879 875 { :method => 'get',
880 876 :path => "/projects/567/time_entries/report.csv" },
881 877 { :controller => 'timelog', :action => 'report', :project_id => '567',
882 878 :format => 'csv' }
883 879 )
884 880 end
885 881
886 882 def test_users
887 883 assert_routing(
888 884 { :method => 'get', :path => "/users" },
889 885 { :controller => 'users', :action => 'index' }
890 886 )
891 887 assert_routing(
892 888 { :method => 'get', :path => "/users.xml" },
893 889 { :controller => 'users', :action => 'index', :format => 'xml' }
894 890 )
895 891 assert_routing(
896 892 { :method => 'get', :path => "/users/44" },
897 893 { :controller => 'users', :action => 'show', :id => '44' }
898 894 )
899 895 assert_routing(
900 896 { :method => 'get', :path => "/users/44.xml" },
901 897 { :controller => 'users', :action => 'show', :id => '44',
902 898 :format => 'xml' }
903 899 )
904 900 assert_routing(
905 901 { :method => 'get', :path => "/users/current" },
906 902 { :controller => 'users', :action => 'show', :id => 'current' }
907 903 )
908 904 assert_routing(
909 905 { :method => 'get', :path => "/users/current.xml" },
910 906 { :controller => 'users', :action => 'show', :id => 'current',
911 907 :format => 'xml' }
912 908 )
913 909 assert_routing(
914 910 { :method => 'get', :path => "/users/new" },
915 911 { :controller => 'users', :action => 'new' }
916 912 )
917 913 assert_routing(
918 914 { :method => 'get', :path => "/users/444/edit" },
919 915 { :controller => 'users', :action => 'edit', :id => '444' }
920 916 )
921 917 assert_routing(
922 918 { :method => 'post', :path => "/users" },
923 919 { :controller => 'users', :action => 'create' }
924 920 )
925 921 assert_routing(
926 922 { :method => 'post', :path => "/users.xml" },
927 923 { :controller => 'users', :action => 'create', :format => 'xml' }
928 924 )
929 925 assert_routing(
930 926 { :method => 'put', :path => "/users/444" },
931 927 { :controller => 'users', :action => 'update', :id => '444' }
932 928 )
933 929 assert_routing(
934 930 { :method => 'put', :path => "/users/444.xml" },
935 931 { :controller => 'users', :action => 'update', :id => '444',
936 932 :format => 'xml' }
937 933 )
938 934 assert_routing(
939 935 { :method => 'delete', :path => "/users/44" },
940 936 { :controller => 'users', :action => 'destroy', :id => '44' }
941 937 )
942 938 assert_routing(
943 939 { :method => 'delete', :path => "/users/44.xml" },
944 940 { :controller => 'users', :action => 'destroy', :id => '44',
945 941 :format => 'xml' }
946 942 )
947 943 assert_routing(
948 944 { :method => 'post', :path => "/users/123/memberships" },
949 945 { :controller => 'users', :action => 'edit_membership',
950 946 :id => '123' }
951 947 )
952 948 assert_routing(
953 949 { :method => 'put', :path => "/users/123/memberships/55" },
954 950 { :controller => 'users', :action => 'edit_membership',
955 951 :id => '123', :membership_id => '55' }
956 952 )
957 953 assert_routing(
958 954 { :method => 'delete', :path => "/users/123/memberships/55" },
959 955 { :controller => 'users', :action => 'destroy_membership',
960 956 :id => '123', :membership_id => '55' }
961 957 )
962 958 end
963 959
964 960 def test_versions
965 961 # /projects/foo/versions is /projects/foo/roadmap
966 962 assert_routing(
967 963 { :method => 'get', :path => "/projects/foo/versions.xml" },
968 964 { :controller => 'versions', :action => 'index',
969 965 :project_id => 'foo', :format => 'xml' }
970 966 )
971 967 assert_routing(
972 968 { :method => 'get', :path => "/projects/foo/versions.json" },
973 969 { :controller => 'versions', :action => 'index',
974 970 :project_id => 'foo', :format => 'json' }
975 971 )
976 972 assert_routing(
977 973 { :method => 'get', :path => "/projects/foo/versions/new" },
978 974 { :controller => 'versions', :action => 'new',
979 975 :project_id => 'foo' }
980 976 )
981 977 assert_routing(
982 978 { :method => 'post', :path => "/projects/foo/versions" },
983 979 { :controller => 'versions', :action => 'create',
984 980 :project_id => 'foo' }
985 981 )
986 982 assert_routing(
987 983 { :method => 'post', :path => "/projects/foo/versions.xml" },
988 984 { :controller => 'versions', :action => 'create',
989 985 :project_id => 'foo', :format => 'xml' }
990 986 )
991 987 assert_routing(
992 988 { :method => 'post', :path => "/projects/foo/versions.json" },
993 989 { :controller => 'versions', :action => 'create',
994 990 :project_id => 'foo', :format => 'json' }
995 991 )
996 992 assert_routing(
997 993 { :method => 'get', :path => "/versions/1" },
998 994 { :controller => 'versions', :action => 'show', :id => '1' }
999 995 )
1000 996 assert_routing(
1001 997 { :method => 'get', :path => "/versions/1.xml" },
1002 998 { :controller => 'versions', :action => 'show', :id => '1',
1003 999 :format => 'xml' }
1004 1000 )
1005 1001 assert_routing(
1006 1002 { :method => 'get', :path => "/versions/1.json" },
1007 1003 { :controller => 'versions', :action => 'show', :id => '1',
1008 1004 :format => 'json' }
1009 1005 )
1010 1006 assert_routing(
1011 1007 { :method => 'get', :path => "/versions/1/edit" },
1012 1008 { :controller => 'versions', :action => 'edit', :id => '1' }
1013 1009 )
1014 1010 assert_routing(
1015 1011 { :method => 'put', :path => "/versions/1" },
1016 1012 { :controller => 'versions', :action => 'update', :id => '1' }
1017 1013 )
1018 1014 assert_routing(
1019 1015 { :method => 'put', :path => "/versions/1.xml" },
1020 1016 { :controller => 'versions', :action => 'update', :id => '1',
1021 1017 :format => 'xml' }
1022 1018 )
1023 1019 assert_routing(
1024 1020 { :method => 'put', :path => "/versions/1.json" },
1025 1021 { :controller => 'versions', :action => 'update', :id => '1',
1026 1022 :format => 'json' }
1027 1023 )
1028 1024 assert_routing(
1029 1025 { :method => 'delete', :path => "/versions/1" },
1030 1026 { :controller => 'versions', :action => 'destroy', :id => '1' }
1031 1027 )
1032 1028 assert_routing(
1033 1029 { :method => 'delete', :path => "/versions/1.xml" },
1034 1030 { :controller => 'versions', :action => 'destroy', :id => '1',
1035 1031 :format => 'xml' }
1036 1032 )
1037 1033 assert_routing(
1038 1034 { :method => 'delete', :path => "/versions/1.json" },
1039 1035 { :controller => 'versions', :action => 'destroy', :id => '1',
1040 1036 :format => 'json' }
1041 1037 )
1042 1038 assert_routing(
1043 1039 { :method => 'put', :path => "/projects/foo/versions/close_completed" },
1044 1040 { :controller => 'versions', :action => 'close_completed',
1045 1041 :project_id => 'foo' }
1046 1042 )
1047 1043 assert_routing(
1048 1044 { :method => 'post', :path => "/versions/1/status_by" },
1049 1045 { :controller => 'versions', :action => 'status_by', :id => '1' }
1050 1046 )
1051 1047 end
1052 1048
1053 1049 def test_welcome
1054 1050 assert_routing(
1055 1051 { :method => 'get', :path => "/robots.txt" },
1056 1052 { :controller => 'welcome', :action => 'robots' }
1057 1053 )
1058 1054 end
1059 1055
1060 1056 def test_wiki_singular_projects_pages
1061 1057 assert_routing(
1062 1058 { :method => 'get', :path => "/projects/567/wiki" },
1063 1059 { :controller => 'wiki', :action => 'show', :project_id => '567' }
1064 1060 )
1065 1061 assert_routing(
1066 1062 { :method => 'get', :path => "/projects/567/wiki/lalala" },
1067 1063 { :controller => 'wiki', :action => 'show', :project_id => '567',
1068 1064 :id => 'lalala' }
1069 1065 )
1070 1066 assert_routing(
1071 1067 { :method => 'get', :path => "/projects/567/wiki/my_page/edit" },
1072 1068 { :controller => 'wiki', :action => 'edit', :project_id => '567',
1073 1069 :id => 'my_page' }
1074 1070 )
1075 1071 assert_routing(
1076 1072 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" },
1077 1073 { :controller => 'wiki', :action => 'history', :project_id => '1',
1078 1074 :id => 'CookBook_documentation' }
1079 1075 )
1080 1076 assert_routing(
1081 1077 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" },
1082 1078 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1083 1079 :id => 'CookBook_documentation' }
1084 1080 )
1085 1081 assert_routing(
1086 1082 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" },
1087 1083 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1088 1084 :id => 'CookBook_documentation', :version => '2' }
1089 1085 )
1090 1086 assert_routing(
1091 1087 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" },
1092 1088 { :controller => 'wiki', :action => 'diff', :project_id => '1',
1093 1089 :id => 'CookBook_documentation', :version => '2', :version_from => '1' }
1094 1090 )
1095 1091 assert_routing(
1096 1092 { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" },
1097 1093 { :controller => 'wiki', :action => 'annotate', :project_id => '1',
1098 1094 :id => 'CookBook_documentation', :version => '2' }
1099 1095 )
1100 1096 assert_routing(
1101 1097 { :method => 'get', :path => "/projects/22/wiki/ladida/rename" },
1102 1098 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1103 1099 :id => 'ladida' }
1104 1100 )
1105 1101 assert_routing(
1106 1102 { :method => 'get', :path => "/projects/567/wiki/index" },
1107 1103 { :controller => 'wiki', :action => 'index', :project_id => '567' }
1108 1104 )
1109 1105 assert_routing(
1110 1106 { :method => 'get', :path => "/projects/567/wiki/date_index" },
1111 1107 { :controller => 'wiki', :action => 'date_index', :project_id => '567' }
1112 1108 )
1113 1109 assert_routing(
1114 1110 { :method => 'get', :path => "/projects/567/wiki/export" },
1115 1111 { :controller => 'wiki', :action => 'export', :project_id => '567' }
1116 1112 )
1117 1113 assert_routing(
1118 1114 { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" },
1119 1115 { :controller => 'wiki', :action => 'preview', :project_id => '567',
1120 1116 :id => 'CookBook_documentation' }
1121 1117 )
1122 1118 assert_routing(
1123 1119 { :method => 'post', :path => "/projects/22/wiki/ladida/rename" },
1124 1120 { :controller => 'wiki', :action => 'rename', :project_id => '22',
1125 1121 :id => 'ladida' }
1126 1122 )
1127 1123 assert_routing(
1128 1124 { :method => 'post', :path => "/projects/22/wiki/ladida/protect" },
1129 1125 { :controller => 'wiki', :action => 'protect', :project_id => '22',
1130 1126 :id => 'ladida' }
1131 1127 )
1132 1128 assert_routing(
1133 1129 { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" },
1134 1130 { :controller => 'wiki', :action => 'add_attachment', :project_id => '22',
1135 1131 :id => 'ladida' }
1136 1132 )
1137 1133 assert_routing(
1138 1134 { :method => 'put', :path => "/projects/567/wiki/my_page" },
1139 1135 { :controller => 'wiki', :action => 'update', :project_id => '567',
1140 1136 :id => 'my_page' }
1141 1137 )
1142 1138 assert_routing(
1143 1139 { :method => 'delete', :path => "/projects/22/wiki/ladida" },
1144 1140 { :controller => 'wiki', :action => 'destroy', :project_id => '22',
1145 1141 :id => 'ladida' }
1146 1142 )
1147 1143 end
1148 1144
1149 1145 def test_wikis_plural_admin_setup
1150 1146 assert_routing(
1151 1147 { :method => 'get', :path => "/projects/ladida/wiki/destroy" },
1152 1148 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1153 1149 )
1154 1150 assert_routing(
1155 1151 { :method => 'post', :path => "/projects/ladida/wiki" },
1156 1152 { :controller => 'wikis', :action => 'edit', :id => 'ladida' }
1157 1153 )
1158 1154 assert_routing(
1159 1155 { :method => 'post', :path => "/projects/ladida/wiki/destroy" },
1160 1156 { :controller => 'wikis', :action => 'destroy', :id => 'ladida' }
1161 1157 )
1162 1158 end
1163 1159 end
General Comments 0
You need to be logged in to leave comments. Login now