From d2cb9d5289e485a77a40899a43a2283ace7c957e Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 8 Apr 2012 20:06:53 +0000 Subject: Adds missing route to project search. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9371 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/layout_test.rb | 10 ++++++++++ test/integration/routing/search_test.rb | 4 ++++ 2 files changed, 14 insertions(+) (limited to 'test') diff --git a/test/integration/layout_test.rb b/test/integration/layout_test.rb index 853bfea4a..682b9bee5 100644 --- a/test/integration/layout_test.rb +++ b/test/integration/layout_test.rb @@ -53,4 +53,14 @@ class LayoutTest < ActionController::IntegrationTest :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 diff --git a/test/integration/routing/search_test.rb b/test/integration/routing/search_test.rb index 23c1271eb..f5b24ce35 100644 --- a/test/integration/routing/search_test.rb +++ b/test/integration/routing/search_test.rb @@ -23,5 +23,9 @@ class RoutingSearchTest < ActionController::IntegrationTest { :method => 'get', :path => "/search" }, { :controller => 'search', :action => 'index' } ) + assert_routing( + { :method => 'get', :path => "/projects/foo/search" }, + { :controller => 'search', :action => 'index', :id => 'foo' } + ) end end -- cgit v1.2.3