]> source.dussan.org Git - redmine.git/commitdiff
Fixed: unified diff link broken on specific file/revision diff (#11325).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jul 2012 19:17:43 +0000 (19:17 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Wed, 4 Jul 2012 19:17:43 +0000 (19:17 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9909 e93f8b46-1217-0410-a6f0-8f06a7374b81

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

index e79d0226fa0f6e1d851606009f4d6f68bcc43a79..1ecaba8af71659267fe6438e60f9a0b859289f8e 100644 (file)
@@ -226,6 +226,7 @@ RedmineApp::Application.routes.draw do
   get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions'
   get 'projects/:id/repository/:repository_id/revisions/:rev/:action(/*path(.:ext))',
       :controller => 'repositories',
+      :format => false,
       :constraints => {
             :action => /(browse|show|entry|raw|annotate|diff)/,
             :rev    => /[a-z0-9\.\-_]+/
@@ -244,6 +245,7 @@ RedmineApp::Application.routes.draw do
   delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue'
   get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))',
       :controller => 'repositories',
+      :format => false,
       :constraints => {
             :action => /(browse|show|entry|raw|annotate|diff)/,
             :rev    => /[a-z0-9\.\-_]+/
index 2351721bbf9ec7f29497dea60fc4d7710dd9f21c..fc4b54c6c50f6b0ac51bdef8465b7fc68a7ca31e 100644 (file)
@@ -140,9 +140,11 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
       )
     assert_routing(
         { :method => 'get',
-          :path => "/projects/redmine/repository/revisions/2457/diff.diff" },
+          :path => "/projects/redmine/repository/revisions/2457/diff" },
         { :controller => 'repositories', :action => 'diff', :id => 'redmine',
-          :rev => '2457', :format => 'diff' }
+          :rev => '2457', :format => 'diff' },
+        {},
+        { :format => 'diff' }
       )
     assert_routing(
         { :method => 'get',
@@ -150,6 +152,14 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'diff', :id => 'redmine',
           :path => @path_hash[:param], :rev => '2' }
       )
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/revisions/2/diff/#{@path_hash[:path]}" },
+        { :controller => 'repositories', :action => 'diff', :id => 'redmine',
+          :path => @path_hash[:param], :rev => '2', :format => 'diff' },
+        {},
+        { :format => 'diff' }
+      )
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/revisions/2/entry/#{@path_hash[:path]}" },
@@ -209,9 +219,11 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
       )
     assert_routing(
         { :method => 'get',
-          :path => "/projects/redmine/repository/foo/revisions/2457/diff.diff" },
+          :path => "/projects/redmine/repository/foo/revisions/2457/diff" },
         { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
-          :rev => '2457', :format => 'diff' }
+          :rev => '2457', :format => 'diff' },
+        {},
+        { :format => 'diff' }
       )
     assert_routing(
         { :method => 'get',
@@ -219,6 +231,14 @@ class RoutingRepositoriesTest < ActionController::IntegrationTest
         { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
           :path => @path_hash[:param], :rev => '2' }
       )
+    assert_routing(
+        { :method => 'get',
+          :path => "/projects/redmine/repository/foo/revisions/2/diff/#{@path_hash[:path]}" },
+        { :controller => 'repositories', :action => 'diff', :id => 'redmine', :repository_id => 'foo',
+          :path => @path_hash[:param], :rev => '2', :format => 'diff' },
+        {},
+        { :format => 'diff' }
+      )
     assert_routing(
         { :method => 'get',
           :path => "/projects/redmine/repository/foo/revisions/2/entry/#{@path_hash[:path]}" },