test: replace "should_route" of "issues" extra actions to "assert_routing" at integration/routing_test.rb

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8256 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-17 11:54:37 +00:00
parent dcce70095b
commit 15f4e56c9d
1 changed files with 77 additions and 28 deletions

View File

@ -287,34 +287,83 @@ class RoutingTest < ActionController::IntegrationTest
) )
end end
context "issues" do def test_issues_extra_actions
# Extra actions assert_routing(
should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' { :method => 'get', :path => "/projects/23/issues/64/copy" },
{ :controller => 'issues', :action => 'new', :project_id => '23',
should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' :copy_from => '64' }
should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' )
assert_routing(
should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' { :method => 'get', :path => "/issues/move/new" },
{ :controller => 'issue_moves', :action => 'new' }
should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' )
should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' assert_routing(
{ :method => 'post', :path => "/issues/move" },
should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' { :controller => 'issue_moves', :action => 'create' }
should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' )
should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' assert_routing(
should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' { :method => 'post', :path => "/issues/1/quoted" },
{ :controller => 'journals', :action => 'new', :id => '1' }
should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' )
assert_routing(
should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' { :method => 'get', :path => "/issues/calendar" },
should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' { :controller => 'calendars', :action => 'show' }
should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' )
should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' assert_routing(
{ :method => 'get', :path => "/projects/project-name/issues/calendar" },
should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' { :controller => 'calendars', :action => 'show',
:project_id => 'project-name' }
should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' )
should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update' assert_routing(
{ :method => 'get', :path => "/issues/gantt" },
{ :controller => 'gantts', :action => 'show' }
)
assert_routing(
{ :method => 'get', :path => "/issues/gantt.pdf" },
{ :controller => 'gantts', :action => 'show', :format => 'pdf' }
)
assert_routing(
{ :method => 'get', :path => "/projects/project-name/issues/gantt" },
{ :controller => 'gantts', :action => 'show',
:project_id => 'project-name' }
)
assert_routing(
{ :method => 'get', :path => "/projects/project-name/issues/gantt.pdf" },
{ :controller => 'gantts', :action => 'show',
:project_id => 'project-name', :format => 'pdf' }
)
assert_routing(
{ :method => 'get', :path => "/issues/auto_complete" },
{ :controller => 'auto_completes', :action => 'issues' }
)
assert_routing(
{ :method => 'get', :path => "/issues/preview/123" },
{ :controller => 'previews', :action => 'issue', :id => '123' }
)
assert_routing(
{ :method => 'post', :path => "/issues/preview/123" },
{ :controller => 'previews', :action => 'issue', :id => '123' }
)
assert_routing(
{ :method => 'get', :path => "/issues/context_menu" },
{ :controller => 'context_menus', :action => 'issues' }
)
assert_routing(
{ :method => 'post', :path => "/issues/context_menu" },
{ :controller => 'context_menus', :action => 'issues' }
)
assert_routing(
{ :method => 'get', :path => "/issues/changes" },
{ :controller => 'journals', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/issues/bulk_edit" },
{ :controller => 'issues', :action => 'bulk_edit' }
)
assert_routing(
{ :method => 'post', :path => "/issues/bulk_update" },
{ :controller => 'issues', :action => 'bulk_update' }
)
end end
context "issue categories" do context "issue categories" do