summaryrefslogtreecommitdiffstats
path: root/test/functional/search_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-18 16:15:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-05-18 16:15:22 +0000
commit073818f8bc46580e118a7550f1faaa55b3be13d9 (patch)
tree6ea9ab7a218ecdac7f4fba61f339e17d0459f04d /test/functional/search_controller_test.rb
parent1907c31138d065aea93f53b8e7565e06a44e49f8 (diff)
downloadredmine-073818f8bc46580e118a7550f1faaa55b3be13d9.tar.gz
redmine-073818f8bc46580e118a7550f1faaa55b3be13d9.zip
Ability to search all projects or the projects the user belongs to (#791).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1435 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/search_controller_test.rb')
-rw-r--r--test/functional/search_controller_test.rb14
1 files changed, 13 insertions, 1 deletions
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index 49004c7e6..b02f07793 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -5,7 +5,10 @@ require 'search_controller'
class SearchController; def rescue_action(e) raise e end; end
class SearchControllerTest < Test::Unit::TestCase
- fixtures :projects, :enabled_modules, :issues, :custom_fields, :custom_values
+ fixtures :projects, :enabled_modules, :roles, :users,
+ :issues, :trackers, :issue_statuses,
+ :custom_fields, :custom_values,
+ :repositories, :changesets
def setup
@controller = SearchController.new
@@ -25,6 +28,15 @@ class SearchControllerTest < Test::Unit::TestCase
assert assigns(:results).include?(Project.find(1))
end
+ def test_search_all_projects
+ get :index, :q => 'recipe subproject commit', :submit => 'Search'
+ assert_response :success
+ assert_template 'index'
+ assert assigns(:results).include?(Issue.find(2))
+ assert assigns(:results).include?(Issue.find(5))
+ assert assigns(:results).include?(Changeset.find(101))
+ end
+
def test_search_without_searchable_custom_fields
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"