]> source.dussan.org Git - redmine.git/commitdiff
test: route: scm: move changes action tests to non revisions path tests
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 5 May 2012 05:29:43 +0000 (05:29 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 5 May 2012 05:29:43 +0000 (05:29 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9627 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/integration/routing/repositories_test.rb

index 17d391801da44ef5b5bd867d5b6273375b81c278..2351721bbf9ec7f29497dea60fc4d7710dd9f21c 100644 (file)
@@ -132,31 +132,6 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'show', :id => 'redmine',
           :path => @path_hash[:param] , :rev => '2457'}
       )
-    assert_routing(
-        { :method => 'get',
-          :path => "/projects/redmine/repository/changes" },
-        { :controller => 'repositories', :action => 'changes', :id => 'redmine' }
-      )
-    ['2457', 'master', 'slash/slash'].each do |rev|
-      assert_routing(
-           { :method => 'get',
-             :path => "/projects/redmine/repository/changes" },
-           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
-             :rev => rev },
-           {},
-           { :rev => rev }
-         )
-    end
-    ['2457', 'master', 'slash/slash'].each do |rev|
-      assert_routing(
-           { :method => 'get',
-             :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" },
-           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
-             :path => @path_hash[:param], :rev => rev },
-           {},
-           { :rev => rev }
-         )
-    end
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/revisions/2457/diff" },
@@ -226,31 +201,6 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'show', :id => 'redmine', :repository_id => 'foo',
           :path => @path_hash[:param] , :rev => '2457'}
       )
-    assert_routing(
-        { :method => 'get',
-          :path => "/projects/redmine/repository/foo/changes" },
-        { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo' }
-      )
-    ['2457', 'master', 'slash/slash'].each do |rev|
-      assert_routing(
-           { :method => 'get',
-             :path => "/projects/redmine/repository/foo/changes" },
-           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
-             :repository_id => 'foo', :rev => rev },
-           {},
-           { :rev => rev }
-         )
-    end
-    ['2457', 'master', 'slash/slash'].each do |rev|
-      assert_routing(
-           { :method => 'get',
-             :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" },
-           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
-             :repository_id => 'foo', :path => @path_hash[:param], :rev => rev },
-           {},
-           { :rev => rev }
-         )
-    end
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/foo/revisions/2457/diff" },
@@ -290,6 +240,31 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
   end
 
   def test_repositories_non_revisions_path
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/changes" },
+        { :controller => 'repositories', :action => 'changes', :id => 'redmine' }
+      )
+    ['2457', 'master', 'slash/slash'].each do |rev|
+      assert_routing(
+           { :method => 'get',
+             :path => "/projects/redmine/repository/changes" },
+           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
+             :rev => rev },
+           {},
+           { :rev => rev }
+         )
+    end
+    ['2457', 'master', 'slash/slash'].each do |rev|
+      assert_routing(
+           { :method => 'get',
+             :path => "/projects/redmine/repository/changes/#{@path_hash[:path]}" },
+           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
+             :path => @path_hash[:param], :rev => rev },
+           {},
+           { :rev => rev }
+         )
+    end
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/diff/#{@path_hash[:path]}" },
@@ -334,6 +309,33 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
   end
 
   def test_repositories_non_revisions_path_with_repository_id
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/foo/changes" },
+        { :controller => 'repositories', :action => 'changes',
+          :id => 'redmine', :repository_id => 'foo' }
+      )
+    ['2457', 'master', 'slash/slash'].each do |rev|
+      assert_routing(
+           { :method => 'get',
+             :path => "/projects/redmine/repository/foo/changes" },
+           { :controller => 'repositories', :action => 'changes',
+             :id => 'redmine',
+             :repository_id => 'foo', :rev => rev },
+           {},
+           { :rev => rev }
+         )
+    end
+    ['2457', 'master', 'slash/slash'].each do |rev|
+      assert_routing(
+           { :method => 'get',
+             :path => "/projects/redmine/repository/foo/changes/#{@path_hash[:path]}" },
+           { :controller => 'repositories', :action => 'changes', :id => 'redmine',
+             :repository_id => 'foo', :path => @path_hash[:param], :rev => rev },
+           {},
+           { :rev => rev }
+         )
+    end
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/foo/diff/#{@path_hash[:path]}" },