Adds missing route to project search.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9371 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2012-04-08 20:06:53 +00:00
parent d427d8e567
commit d2cb9d5289
3 changed files with 15 additions and 0 deletions

View File

@ -339,6 +339,7 @@ ActionController::Routing::Routes.draw do |map|
map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
map.resources :enumerations, :except => :show map.resources :enumerations, :except => :show
map.connect 'projects/:id/search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
map.connect 'mail_handler', :controller => 'mail_handler', map.connect 'mail_handler', :controller => 'mail_handler',

View File

@ -53,4 +53,14 @@ class LayoutTest < ActionController::IntegrationTest
:attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}}, :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}},
:parent => {:tag => 'head'} :parent => {:tag => 'head'}
end end
def test_search_field_outside_project_should_link_to_global_search
get '/'
assert_select 'div#quick-search form[action=/search]'
end
def test_search_field_inside_project_should_link_to_project_search
get '/projects/ecookbook'
assert_select 'div#quick-search form[action=/projects/ecookbook/search]'
end
end end

View File

@ -23,5 +23,9 @@ class RoutingSearchTest < ActionController::IntegrationTest
{ :method => 'get', :path => "/search" }, { :method => 'get', :path => "/search" },
{ :controller => 'search', :action => 'index' } { :controller => 'search', :action => 'index' }
) )
assert_routing(
{ :method => 'get', :path => "/projects/foo/search" },
{ :controller => 'search', :action => 'index', :id => 'foo' }
)
end end
end end