]> source.dussan.org Git - redmine.git/commitdiff
scm: fix revisions page "OK" button always returns 404 error (#10567)
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 2 Apr 2012 05:09:36 +0000 (05:09 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 2 Apr 2012 05:09:36 +0000 (05:09 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9299 e93f8b46-1217-0410-a6f0-8f06a7374b81

config/routes.rb
test/integration/routing/repositories_test.rb

index 25a7ca59bae893ea3697b5efd79d89f6a0c0e302..5cba46c000522b9f42f707e25eb961e2232697fb 100644 (file)
@@ -270,6 +270,9 @@ ActionController::Routing::Routes.draw do |map|
       repository_views.connect 'projects/:id/repository/:repository_id/show/*path',
                                :requirements => { :path => /.+/ }
 
+      repository_views.connect 'projects/:id/repository/:repository_id/revision',
+                               :action => 'revision'
+
       repository_views.connect 'projects/:id/repository/revisions',
                                :action => 'revisions'
       repository_views.connect 'projects/:id/repository/revisions.:format',
@@ -296,13 +299,12 @@ ActionController::Routing::Routes.draw do |map|
       repository_views.connect 'projects/:id/repository/:action/*path',
                                :requirements => { :action => /(browse|show|entry|changes|annotate|diff)/ }
 
+      repository_views.connect 'projects/:id/repository/revision',
+                               :action => 'revision'
+
       repository_views.connect 'projects/:id/repository/:repository_id',
                                :action => 'show'
     end
-
-    repositories.connect 'projects/:id/repository/revision',
-                         :action => 'revision',
-                         :conditions => {:method => [:get, :post]}
   end
 
   # additional routes for having the file name at the end of url
index 14c835f3722443035054c2655726075b6394b7a0..60a1d408b0f86d2414384747fc71ace421340de4 100644 (file)
@@ -300,6 +300,11 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'changes', :id => 'redmine',
           :path => @path_hash[:param] }
       )
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/revision" },
+        { :controller => 'repositories', :action => 'revision', :id => 'redmine' }
+      )
   end
 
   def test_repositories_non_revisions_path_with_repository_id
@@ -339,6 +344,11 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'changes', :id => 'redmine', :repository_id => 'foo',
           :path => @path_hash[:param] }
       )
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/foo/revision" },
+        { :controller => 'repositories', :action => 'revision', :id => 'redmine', :repository_id => 'foo'}
+      )
   end
 
   def test_repositories_related_issues