map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]}
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 'mail_handler', :controller => 'mail_handler',
:attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}},
:parent => {:tag => 'head'}
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
{ :method => 'get', :path => "/search" },
{ :controller => 'search', :action => 'index' }
)
+ assert_routing(
+ { :method => 'get', :path => "/projects/foo/search" },
+ { :controller => 'search', :action => 'index', :id => 'foo' }
+ )
end
end