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

test/integration/routing/versions_test.rb

index 01cf2e99fa2cd0c30bc6aece7a82d055b57a041c..932a9c5f5191c80e364011306c82d1dc2ecfdda5 100644 (file)
 require File.expand_path('../../../test_helper', __FILE__)
 
 class RoutingVersionsTest < ActionController::IntegrationTest
-  def test_versions
+  def test_versions_scoped_under_project
     # /projects/foo/versions is /projects/foo/roadmap
     assert_routing(
         { :method => 'get', :path => "/projects/33/roadmap" },
         { :controller => 'versions', :action => 'index', :project_id => '33' }
       )
+    assert_routing(
+        { :method => 'put', :path => "/projects/foo/versions/close_completed" },
+        { :controller => 'versions', :action => 'close_completed',
+          :project_id => 'foo' }
+      )
     assert_routing(
         { :method => 'get', :path => "/projects/foo/versions.xml" },
         { :controller => 'versions', :action => 'index',
@@ -54,6 +59,9 @@ class RoutingVersionsTest < ActionController::IntegrationTest
         { :controller => 'versions', :action => 'create',
           :project_id => 'foo', :format => 'json' }
       )
+  end
+
+  def test_versions
     assert_routing(
         { :method => 'get', :path => "/versions/1" },
         { :controller => 'versions', :action => 'show', :id => '1' }
@@ -100,11 +108,6 @@ class RoutingVersionsTest < ActionController::IntegrationTest
         { :controller => 'versions', :action => 'destroy', :id => '1',
           :format => 'json' }
       )
-    assert_routing(
-        { :method => 'put', :path => "/projects/foo/versions/close_completed" },
-        { :controller => 'versions', :action => 'close_completed',
-          :project_id => 'foo' }
-      )
     assert_routing(
         { :method => 'post', :path => "/versions/1/status_by" },
         { :controller => 'versions', :action => 'status_by', :id => '1' }