Commits

Toshi MARUYAMA committed dd9c7ae

test: route: split versions tests whether scoped under project or not

Comments (0)

Files changed (1)

test/integration/routing/versions_test.rb

 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',
           :project_id => 'foo', :format => 'xml' }
         { :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' }
           :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' }
       )