@@ -339,6 +339,7 ActionController::Routing::Routes.draw do |map| | |||
|
339 | 339 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} |
|
340 | 340 | map.resources :enumerations, :except => :show |
|
341 | 341 | |
|
342 | map.connect 'projects/:id/search', :controller => 'search', :action => 'index', :conditions => {:method => :get} | |
|
342 | 343 | map.connect 'search', :controller => 'search', :action => 'index', :conditions => {:method => :get} |
|
343 | 344 | |
|
344 | 345 | map.connect 'mail_handler', :controller => 'mail_handler', |
@@ -53,4 +53,14 class LayoutTest < ActionController::IntegrationTest | |||
|
53 | 53 | :attributes => {:src => %r{^/javascripts/jstoolbar/textile.js}}, |
|
54 | 54 | :parent => {:tag => 'head'} |
|
55 | 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 | 66 | end |
@@ -23,5 +23,9 class RoutingSearchTest < ActionController::IntegrationTest | |||
|
23 | 23 | { :method => 'get', :path => "/search" }, |
|
24 | 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 | 30 | end |
|
27 | 31 | end |
General Comments 0
You need to be logged in to leave comments.
Login now