##// END OF EJS Templates
Adds missing route to project search....
Jean-Philippe Lang -
r9237:d2cb9d5289e4
parent child
Show More
@@ -339,6 +339,7 ActionController::Routing::Routes.draw do |map|
339 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
339 map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
340 map.resources :enumerations, :except => :show
340 map.resources :enumerations, :except => :show
341
341
342 map.connect 'projects/:id/search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
342 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
343 map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get}
343
344
344 map.connect 'mail_handler', :controller => 'mail_handler',
345 map.connect 'mail_handler', :controller => 'mail_handler',
@@ -53,4 +53,14 class LayoutTest < ActionController::IntegrationTest
53 :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}},
53 :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}},
54 :parent => {:tag => 'head'}
54 :parent => {:tag => 'head'}
55 end
55 end
56
57 def test_search_field_outside_project_should_link_to_global_search
58 get '/'
59 assert_select 'div#quick-search form[action=/search]'
60 end
61
62 def test_search_field_inside_project_should_link_to_project_search
63 get '/projects/ecookbook'
64 assert_select 'div#quick-search form[action=/projects/ecookbook/search]'
65 end
56 end
66 end
@@ -23,5 +23,9 class RoutingSearchTest < ActionController::IntegrationTest
23 { :method => 'get', :path => "/search" },
23 { :method => 'get', :path => "/search" },
24 { :controller => 'search', :action => 'index' }
24 { :controller => 'search', :action => 'index' }
25 )
25 )
26 assert_routing(
27 { :method => 'get', :path => "/projects/foo/search" },
28 { :controller => 'search', :action => 'index', :id => 'foo' }
29 )
26 end
30 end
27 end
31 end
General Comments 0
You need to be logged in to leave comments. Login now