summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/routes.rb2
-rw-r--r--test/integration/routing/wiki_test.rb4
2 files changed, 5 insertions, 1 deletions
diff --git a/config/routes.rb b/config/routes.rb
index 72445cc72..228e8bf60 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -157,7 +157,7 @@ RedmineApp::Application.routes.draw do
end
end
match 'wiki', :controller => 'wiki', :action => 'show', :via => :get
- get 'wiki/:id/:version', :to => 'wiki#show'
+ get 'wiki/:id/:version', :to => 'wiki#show', :constraints => {:version => /\d+/}
delete 'wiki/:id/:version', :to => 'wiki#destroy_version'
get 'wiki/:id/:version/annotate', :to => 'wiki#annotate'
get 'wiki/:id/:version/diff', :to => 'wiki#diff'
diff --git a/test/integration/routing/wiki_test.rb b/test/integration/routing/wiki_test.rb
index 5deeb7ee1..b153b095b 100644
--- a/test/integration/routing/wiki_test.rb
+++ b/test/integration/routing/wiki_test.rb
@@ -53,6 +53,10 @@ class RoutingWikiTest < ActionController::IntegrationTest
{ :controller => 'wiki', :action => 'annotate', :project_id => '1',
:id => 'CookBook_documentation', :version => '2' }
)
+ # Make sure we don't route wiki page sub-uris to let plugins handle them
+ assert_raise(ActionController::RoutingError) do
+ assert_recognizes({}, {:method => 'get', :path => "/projects/1/wiki/CookBook_documentation/whatever"})
+ end
end
def test_wiki_misc