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