diff options
author | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-30 05:14:25 +0000 |
---|---|---|
committer | Toshi MARUYAMA <marutosijp2@yahoo.co.jp> | 2011-12-30 05:14:25 +0000 |
commit | 9835f4b800a44b22e5a301427993d467dc5c687a (patch) | |
tree | 3a90c44f92f5942e26b16ed6c933ca71174cef92 /test/integration/routing | |
parent | 1b252d68f3da0a4e8c35df5238255a66361bf673 (diff) | |
download | redmine-9835f4b800a44b22e5a301427993d467dc5c687a.tar.gz redmine-9835f4b800a44b22e5a301427993d467dc5c687a.zip |
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
Diffstat (limited to 'test/integration/routing')
-rw-r--r-- | test/integration/routing/issues_test.rb | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/test/integration/routing/issues_test.rb b/test/integration/routing/issues_test.rb index 379852a2c..7b95360b1 100644 --- a/test/integration/routing/issues_test.rb +++ b/test/integration/routing/issues_test.rb @@ -36,41 +36,44 @@ class RoutingIssuesTest < ActionController::IntegrationTest { :controller => 'issues', :action => 'index', :format => 'xml' } ) assert_routing( - { :method => 'get', :path => "/projects/23/issues" }, - { :controller => 'issues', :action => 'index', :project_id => '23' } + { :method => 'get', :path => "/issues/64" }, + { :controller => 'issues', :action => 'show', :id => '64' } ) assert_routing( - { :method => 'get', :path => "/projects/23/issues.pdf" }, - { :controller => 'issues', :action => 'index', :project_id => '23', + { :method => 'get', :path => "/issues/64.pdf" }, + { :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' } ) assert_routing( - { :method => 'get', :path => "/projects/23/issues.atom" }, - { :controller => 'issues', :action => 'index', :project_id => '23', + { :method => 'get', :path => "/issues/64.atom" }, + { :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' } ) assert_routing( - { :method => 'get', :path => "/projects/23/issues.xml" }, - { :controller => 'issues', :action => 'index', :project_id => '23', + { :method => 'get', :path => "/issues/64.xml" }, + { :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' } ) + end + + def test_issues_rest_actions_scoped_under_project assert_routing( - { :method => 'get', :path => "/issues/64" }, - { :controller => 'issues', :action => 'show', :id => '64' } + { :method => 'get', :path => "/projects/23/issues" }, + { :controller => 'issues', :action => 'index', :project_id => '23' } ) assert_routing( - { :method => 'get', :path => "/issues/64.pdf" }, - { :controller => 'issues', :action => 'show', :id => '64', + { :method => 'get', :path => "/projects/23/issues.pdf" }, + { :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' } ) assert_routing( - { :method => 'get', :path => "/issues/64.atom" }, - { :controller => 'issues', :action => 'show', :id => '64', + { :method => 'get', :path => "/projects/23/issues.atom" }, + { :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' } ) assert_routing( - { :method => 'get', :path => "/issues/64.xml" }, - { :controller => 'issues', :action => 'show', :id => '64', + { :method => 'get', :path => "/projects/23/issues.xml" }, + { :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' } ) assert_routing( |