diff options
-rw-r--r-- | config/routes.rb | 7 | ||||
-rw-r--r-- | test/integration/routing/repositories_test.rb | 24 |
2 files changed, 19 insertions, 12 deletions
diff --git a/config/routes.rb b/config/routes.rb index ca9d77590..2c505693d 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -221,7 +221,9 @@ RedmineApp::Application.routes.draw do :to => 'repositories#changes' get 'projects/:id/repository/:repository_id/revisions/:rev', :to => 'repositories#revision' - get 'projects/:id/repository/:repository_id/revision', :to => 'repositories#revision' + match 'projects/:id/repository/:repository_id/revision', + :to => 'repositories#revision', + :via => [:get, :post] post 'projects/:id/repository/:repository_id/revisions/:rev/issues', :to => 'repositories#add_related_issue' delete 'projects/:id/repository/:repository_id/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' get 'projects/:id/repository/:repository_id/revisions', :to => 'repositories#revisions' @@ -241,7 +243,8 @@ RedmineApp::Application.routes.draw do get 'projects/:id/repository/revisions', :to => 'repositories#revisions' get 'projects/:id/repository/revisions/:rev', :to => 'repositories#revision' - get 'projects/:id/repository/revision', :to => 'repositories#revision' + match 'projects/:id/repository/revision', :to => 'repositories#revision', + :via => [:get, :post] post 'projects/:id/repository/revisions/:rev/issues', :to => 'repositories#add_related_issue' delete 'projects/:id/repository/revisions/:rev/issues/:issue_id', :to => 'repositories#remove_related_issue' get 'projects/:id/repository/revisions/:rev/:action(/*path(.:ext))', diff --git a/test/integration/routing/repositories_test.rb b/test/integration/routing/repositories_test.rb index fc4b54c6c..a6d9fadae 100644 --- a/test/integration/routing/repositories_test.rb +++ b/test/integration/routing/repositories_test.rb @@ -321,11 +321,13 @@ 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' } - ) + ["get", "post"].each do |method| + assert_routing( + { :method => method, + :path => "/projects/redmine/repository/revision" }, + { :controller => 'repositories', :action => 'revision', :id => 'redmine' } + ) + end end def test_repositories_non_revisions_path_with_repository_id @@ -392,11 +394,13 @@ 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'} - ) + ["get", "post"].each do |method| + assert_routing( + { :method => method, + :path => "/projects/redmine/repository/foo/revision" }, + { :controller => 'repositories', :action => 'revision', :id => 'redmine', :repository_id => 'foo'} + ) + end end def test_repositories_related_issues |