diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-14 18:54:55 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2007-12-14 18:54:55 +0000 |
commit | 58610ec52af2249c4c5eebf35e11cd827a7966ab (patch) | |
tree | b699b63943e7de4638a1c7c8ec03e21325f69ea4 /test/functional | |
parent | 38b185f1dc4d296eb49c94a3ccff7496b1367c84 (diff) | |
download | redmine-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.rb | 15 |
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" |