]> source.dussan.org Git - redmine.git/commitdiff
test: route: split issues rest actions tests whether scoped under project or not
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 30 Dec 2011 05:14:25 +0000 (05:14 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Fri, 30 Dec 2011 05:14:25 +0000 (05:14 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8433 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing/issues_test.rb

index 379852a2ca88e0f0c3b9cb69e1e6697f50ef9d25..7b95360b14835e9dc8b4cb1f9de21b445f8eccff 100644 (file)
@@ -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(