summaryrefslogtreecommitdiffstats
path: root/test/functional/search_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-20 17:26:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-07-20 17:26:07 +0000
commitbe2b8a62f4d0d8bf413a5583fe644bd41a8ebf04 (patch)
tree95fe7f273935739e1ffa82be16cee93927a4c054 /test/functional/search_controller_test.rb
parent83baccb71ac0e609ce72ebf322f73884548a9ba5 (diff)
downloadredmine-be2b8a62f4d0d8bf413a5583fe644bd41a8ebf04.tar.gz
redmine-be2b8a62f4d0d8bf413a5583fe644bd41a8ebf04.zip
Search engine: display total results count (#906) and count by result type.
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1681 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/search_controller_test.rb')
-rw-r--r--test/functional/search_controller_test.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb
index 1c505620b..ce06ec298 100644
--- a/test/functional/search_controller_test.rb
+++ b/test/functional/search_controller_test.rb
@@ -32,9 +32,17 @@ class SearchControllerTest < Test::Unit::TestCase
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))
+ assert_tag :dt, :attributes => { :class => /issue/ },
+ :child => { :tag => 'a', :content => /Add ingredients categories/ },
+ :sibling => { :tag => 'dd', :content => /should be classified by categories/ }
+
+ assert assigns(:results_by_type).is_a?(Hash)
+ assert_equal 4, assigns(:results_by_type)['changesets']
+ assert_tag :a, :content => 'Changesets (4)'
end
def test_search_project_and_subprojects