summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-14 18:54:55 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-12-14 18:54:55 +0000
commit58610ec52af2249c4c5eebf35e11cd827a7966ab (patch)
treeb699b63943e7de4638a1c7c8ec03e21325f69ea4 /test/functional
parent38b185f1dc4d296eb49c94a3ccff7496b1367c84 (diff)
downloadredmine-58610ec52af2249c4c5eebf35e11cd827a7966ab.tar.gz
redmine-58610ec52af2249c4c5eebf35e11cd827a7966ab.zip
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
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/search_controller_test.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index 5e3673a4e..330cd0de0 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -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"