Search engine: issue custom fields can now be searched.

Each issue custom field (excepting numeric, date and boolean fields) can be marked as "Searchable" (default to false).

git-svn-id: http://redmine.rubyforge.org/svn/trunk@994 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2007-12-14 18:54:55 +00:00
parent 38b185f1dc
commit 58610ec52a
27 changed files with 89 additions and 11 deletions
+13 -2
View File
@@ -5,7 +5,7 @@ require 'search_controller'
class SearchController; def rescue_action(e) raise e end; end
class SearchControllerTest < Test::Unit::TestCase
fixtures :projects, :issues
fixtures :projects, :issues, :custom_fields, :custom_values
def setup
@controller = SearchController.new
@@ -25,7 +25,9 @@ class SearchControllerTest < Test::Unit::TestCase
assert assigns(:results).include?(Project.find(1))
end
def test_search_in_project
def test_search_without_searchable_custom_fields
CustomField.update_all "searchable = #{ActiveRecord::Base.connection.quoted_false}"
get :index, :id => 1
assert_response :success
assert_template 'index'
@@ -36,6 +38,15 @@ class SearchControllerTest < Test::Unit::TestCase
assert_template 'index'
end
def test_search_with_searchable_custom_fields
get :index, :id => 1, :q => "stringforcustomfield"
assert_response :success
results = assigns(:results)
assert_not_nil results
assert_equal 1, results.size
assert results.include?(Issue.find(3))
end
def test_quick_jump_to_issue
# issue of a public project
get :index, :q => "3"