@@ -440,34 +440,110 class RoutingTest < ActionController::IntegrationTest | |||||
440 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' |
|
440 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' | |
441 | end |
|
441 | end | |
442 |
|
442 | |||
443 |
|
|
443 | def test_projects | |
444 | should_route :get, "/projects", :controller => 'projects', :action => 'index' |
|
444 | assert_routing( | |
445 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' |
|
445 | { :method => 'get', :path => "/projects" }, | |
446 |
|
|
446 | { :controller => 'projects', :action => 'index' } | |
447 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' |
|
447 | ) | |
448 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' |
|
448 | assert_routing( | |
449 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' |
|
449 | { :method => 'get', :path => "/projects.atom" }, | |
450 |
|
|
450 | { :controller => 'projects', :action => 'index', :format => 'atom' } | |
451 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' |
|
451 | ) | |
452 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' |
|
452 | assert_routing( | |
453 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' |
|
453 | { :method => 'get', :path => "/projects.xml" }, | |
454 |
|
|
454 | { :controller => 'projects', :action => 'index', :format => 'xml' } | |
455 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' |
|
455 | ) | |
456 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' |
|
456 | assert_routing( | |
457 |
|
457 | { :method => 'get', :path => "/projects/new" }, | ||
458 |
|
|
458 | { :controller => 'projects', :action => 'new' } | |
459 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' |
|
459 | ) | |
460 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' |
|
460 | assert_routing( | |
461 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' |
|
461 | { :method => 'get', :path => "/projects/test" }, | |
462 |
|
|
462 | { :controller => 'projects', :action => 'show', :id => 'test' } | |
463 |
|
463 | ) | ||
464 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' |
|
464 | assert_routing( | |
465 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' |
|
465 | { :method => 'get', :path => "/projects/1.xml" }, | |
466 |
|
|
466 | { :controller => 'projects', :action => 'show', :id => '1', | |
467 |
|
467 | :format => 'xml' } | ||
468 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' |
|
468 | ) | |
469 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
|
469 | assert_routing( | |
470 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
|
470 | { :method => 'get', :path => "/projects/4223/settings" }, | |
|
471 | { :controller => 'projects', :action => 'settings', :id => '4223' } | |||
|
472 | ) | |||
|
473 | assert_routing( | |||
|
474 | { :method => 'get', :path => "/projects/4223/settings/members" }, | |||
|
475 | { :controller => 'projects', :action => 'settings', :id => '4223', | |||
|
476 | :tab => 'members' } | |||
|
477 | ) | |||
|
478 | assert_routing( | |||
|
479 | { :method => 'get', :path => "/projects/33/files" }, | |||
|
480 | { :controller => 'files', :action => 'index', :project_id => '33' } | |||
|
481 | ) | |||
|
482 | assert_routing( | |||
|
483 | { :method => 'get', :path => "/projects/33/files/new" }, | |||
|
484 | { :controller => 'files', :action => 'new', :project_id => '33' } | |||
|
485 | ) | |||
|
486 | assert_routing( | |||
|
487 | { :method => 'get', :path => "/projects/33/roadmap" }, | |||
|
488 | { :controller => 'versions', :action => 'index', :project_id => '33' } | |||
|
489 | ) | |||
|
490 | assert_routing( | |||
|
491 | { :method => 'get', :path => "/projects/33/activity" }, | |||
|
492 | { :controller => 'activities', :action => 'index', :id => '33' } | |||
|
493 | ) | |||
|
494 | assert_routing( | |||
|
495 | { :method => 'get', :path => "/projects/33/activity.atom" }, | |||
|
496 | { :controller => 'activities', :action => 'index', :id => '33', | |||
|
497 | :format => 'atom' } | |||
|
498 | ) | |||
|
499 | assert_routing( | |||
|
500 | { :method => 'post', :path => "/projects" }, | |||
|
501 | { :controller => 'projects', :action => 'create' } | |||
|
502 | ) | |||
|
503 | assert_routing( | |||
|
504 | { :method => 'post', :path => "/projects.xml" }, | |||
|
505 | { :controller => 'projects', :action => 'create', :format => 'xml' } | |||
|
506 | ) | |||
|
507 | assert_routing( | |||
|
508 | { :method => 'post', :path => "/projects/33/files" }, | |||
|
509 | { :controller => 'files', :action => 'create', :project_id => '33' } | |||
|
510 | ) | |||
|
511 | assert_routing( | |||
|
512 | { :method => 'post', :path => "/projects/64/archive" }, | |||
|
513 | { :controller => 'projects', :action => 'archive', :id => '64' } | |||
|
514 | ) | |||
|
515 | assert_routing( | |||
|
516 | { :method => 'post', :path => "/projects/64/unarchive" }, | |||
|
517 | { :controller => 'projects', :action => 'unarchive', :id => '64' } | |||
|
518 | ) | |||
|
519 | assert_routing( | |||
|
520 | { :method => 'put', :path => "/projects/64/enumerations" }, | |||
|
521 | { :controller => 'project_enumerations', :action => 'update', | |||
|
522 | :project_id => '64' } | |||
|
523 | ) | |||
|
524 | assert_routing( | |||
|
525 | { :method => 'put', :path => "/projects/4223" }, | |||
|
526 | { :controller => 'projects', :action => 'update', :id => '4223' } | |||
|
527 | ) | |||
|
528 | assert_routing( | |||
|
529 | { :method => 'put', :path => "/projects/1.xml" }, | |||
|
530 | { :controller => 'projects', :action => 'update', :id => '1', | |||
|
531 | :format => 'xml' } | |||
|
532 | ) | |||
|
533 | assert_routing( | |||
|
534 | { :method => 'delete', :path => "/projects/64" }, | |||
|
535 | { :controller => 'projects', :action => 'destroy', :id => '64' } | |||
|
536 | ) | |||
|
537 | assert_routing( | |||
|
538 | { :method => 'delete', :path => "/projects/1.xml" }, | |||
|
539 | { :controller => 'projects', :action => 'destroy', :id => '1', | |||
|
540 | :format => 'xml' } | |||
|
541 | ) | |||
|
542 | assert_routing( | |||
|
543 | { :method => 'delete', :path => "/projects/64/enumerations" }, | |||
|
544 | { :controller => 'project_enumerations', :action => 'destroy', | |||
|
545 | :project_id => '64' } | |||
|
546 | ) | |||
471 | end |
|
547 | end | |
472 |
|
548 | |||
473 | context "queries" do |
|
549 | context "queries" do |
General Comments 0
You need to be logged in to leave comments.
Login now