test: route: split issues rest actions tests whether scoped under project or not

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8433 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Toshi MARUYAMA 2011-12-30 05:14:25 +00:00
parent 1b252d68f3
commit 9835f4b800
1 changed files with 22 additions and 19 deletions

View File

@ -35,25 +35,6 @@ class RoutingIssuesTest < ActionController::IntegrationTest
{ :method => 'get', :path => "/issues.xml" },
{ :controller => 'issues', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues" },
{ :controller => 'issues', :action => 'index', :project_id => '23' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.pdf" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'pdf' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.atom" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.xml" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/issues/64" },
{ :controller => 'issues', :action => 'show', :id => '64' }
@ -73,6 +54,28 @@ class RoutingIssuesTest < ActionController::IntegrationTest
{ :controller => 'issues', :action => 'show', :id => '64',
:format => 'xml' }
)
end
def test_issues_rest_actions_scoped_under_project
assert_routing(
{ :method => 'get', :path => "/projects/23/issues" },
{ :controller => 'issues', :action => 'index', :project_id => '23' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.pdf" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'pdf' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.atom" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.xml" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues/new" },
{ :controller => 'issues', :action => 'new', :project_id => '23' }