@@ -487,26 +487,110 class RoutingTest < ActionController::IntegrationTest | |||||
487 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' |
|
487 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' | |
488 | end |
|
488 | end | |
489 |
|
489 | |||
490 |
|
|
490 | def test_repositories | |
491 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
|
491 | assert_routing( | |
492 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
492 | { :method => 'get', | |
493 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' |
|
493 | :path => "/projects/redmine/repository" }, | |
494 |
|
|
494 | { :controller => 'repositories', :action => 'show', :id => 'redmine' } | |
495 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' |
|
495 | ) | |
496 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' |
|
496 | assert_routing( | |
497 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' |
|
497 | { :method => 'get', | |
498 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] |
|
498 | :path => "/projects/redmine/repository/edit" }, | |
499 | should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2' |
|
499 | { :controller => 'repositories', :action => 'edit', :id => 'redmine' } | |
500 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] |
|
500 | ) | |
501 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] |
|
501 | assert_routing( | |
502 | should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2' |
|
502 | { :method => 'get', | |
503 | should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw' |
|
503 | :path => "/projects/redmine/repository/revisions" }, | |
504 | should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw' |
|
504 | { :controller => 'repositories', :action => 'revisions', :id => 'redmine' } | |
505 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] |
|
505 | ) | |
506 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] |
|
506 | assert_routing( | |
507 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' |
|
507 | { :method => 'get', | |
508 |
|
508 | :path => "/projects/redmine/repository/revisions.atom" }, | ||
509 |
|
|
509 | { :controller => 'repositories', :action => 'revisions', :id => 'redmine', | |
|
510 | :format => 'atom' } | |||
|
511 | ) | |||
|
512 | assert_routing( | |||
|
513 | { :method => 'get', | |||
|
514 | :path => "/projects/redmine/repository/revisions/2457" }, | |||
|
515 | { :controller => 'repositories', :action => 'revision', :id => 'redmine', | |||
|
516 | :rev => '2457' } | |||
|
517 | ) | |||
|
518 | assert_routing( | |||
|
519 | { :method => 'get', | |||
|
520 | :path => "/projects/redmine/repository/revisions/2457/diff" }, | |||
|
521 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |||
|
522 | :rev => '2457' } | |||
|
523 | ) | |||
|
524 | assert_routing( | |||
|
525 | { :method => 'get', | |||
|
526 | :path => "/projects/redmine/repository/revisions/2457/diff.diff" }, | |||
|
527 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |||
|
528 | :rev => '2457', :format => 'diff' } | |||
|
529 | ) | |||
|
530 | assert_routing( | |||
|
531 | { :method => 'get', | |||
|
532 | :path => "/projects/redmine/repository/diff/path/to/file.c" }, | |||
|
533 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |||
|
534 | :path => %w[path to file.c] } | |||
|
535 | ) | |||
|
536 | assert_routing( | |||
|
537 | { :method => 'get', | |||
|
538 | :path => "/projects/redmine/repository/revisions/2/diff/path/to/file.c" }, | |||
|
539 | { :controller => 'repositories', :action => 'diff', :id => 'redmine', | |||
|
540 | :path => %w[path to file.c], :rev => '2' } | |||
|
541 | ) | |||
|
542 | assert_routing( | |||
|
543 | { :method => 'get', | |||
|
544 | :path => "/projects/redmine/repository/browse/path/to/file.c" }, | |||
|
545 | { :controller => 'repositories', :action => 'browse', :id => 'redmine', | |||
|
546 | :path => %w[path to file.c] } | |||
|
547 | ) | |||
|
548 | assert_routing( | |||
|
549 | { :method => 'get', | |||
|
550 | :path => "/projects/redmine/repository/entry/path/to/file.c" }, | |||
|
551 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', | |||
|
552 | :path => %w[path to file.c] } | |||
|
553 | ) | |||
|
554 | assert_routing( | |||
|
555 | { :method => 'get', | |||
|
556 | :path => "/projects/redmine/repository/revisions/2/entry/path/to/file.c" }, | |||
|
557 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', | |||
|
558 | :path => %w[path to file.c], :rev => '2' } | |||
|
559 | ) | |||
|
560 | assert_routing( | |||
|
561 | { :method => 'get', | |||
|
562 | :path => "/projects/redmine/repository/raw/path/to/file.c" }, | |||
|
563 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', | |||
|
564 | :path => %w[path to file.c], :format => 'raw' } | |||
|
565 | ) | |||
|
566 | assert_routing( | |||
|
567 | { :method => 'get', | |||
|
568 | :path => "/projects/redmine/repository/revisions/2/raw/path/to/file.c" }, | |||
|
569 | { :controller => 'repositories', :action => 'entry', :id => 'redmine', | |||
|
570 | :path => %w[path to file.c], :rev => '2', :format => 'raw' } | |||
|
571 | ) | |||
|
572 | assert_routing( | |||
|
573 | { :method => 'get', | |||
|
574 | :path => "/projects/redmine/repository/annotate/path/to/file.c" }, | |||
|
575 | { :controller => 'repositories', :action => 'annotate', :id => 'redmine', | |||
|
576 | :path => %w[path to file.c] } | |||
|
577 | ) | |||
|
578 | assert_routing( | |||
|
579 | { :method => 'get', | |||
|
580 | :path => "/projects/redmine/repository/changes/path/to/file.c" }, | |||
|
581 | { :controller => 'repositories', :action => 'changes', :id => 'redmine', | |||
|
582 | :path => %w[path to file.c] } | |||
|
583 | ) | |||
|
584 | assert_routing( | |||
|
585 | { :method => 'get', | |||
|
586 | :path => "/projects/redmine/repository/statistics" }, | |||
|
587 | { :controller => 'repositories', :action => 'stats', :id => 'redmine' } | |||
|
588 | ) | |||
|
589 | assert_routing( | |||
|
590 | { :method => 'post', | |||
|
591 | :path => "/projects/redmine/repository/edit" }, | |||
|
592 | { :controller => 'repositories', :action => 'edit', :id => 'redmine' } | |||
|
593 | ) | |||
510 | end |
|
594 | end | |
511 |
|
595 | |||
512 | context "roles" do |
|
596 | context "roles" do |
General Comments 0
You need to be logged in to leave comments.
Login now