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
This commit is contained in:
Jean-Philippe Lang
2008-07-20 17:26:07 +00:00
parent 83baccb71a
commit be2b8a62f4
9 changed files with 101 additions and 46 deletions

View File

@@ -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