From 8b957e61532b0140b038ff6825a1a181f4177067 Mon Sep 17 00:00:00 2001 From: MoisesMachado Date: Fri, 27 Jun 2008 18:33:47 +0000 Subject: [PATCH] ActionItem489: fixing test for listing person with first name only --- app/controllers/public/search_controller.rb | 12 +++++++----- test/functional/search_controller_test.rb | 5 ++++- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/app/controllers/public/search_controller.rb b/app/controllers/public/search_controller.rb index 393cd57..7107262 100644 --- a/app/controllers/public/search_controller.rb +++ b/app/controllers/public/search_controller.rb @@ -118,7 +118,9 @@ class SearchController < ApplicationController number_of_result_assets = @searching.values.select{|v| v}.size # apply limit when searching for only one type of asset - limit = (number_of_result_assets == 1) ? LIST_LIMIT : nil +# limit = (number_of_result_assets == 1) ? LIST_LIMIT : nil + # apply limit to all searches + limit = nil @results = {} @names = {} @@ -148,10 +150,10 @@ class SearchController < ApplicationController def products @results[:products].uniq! - if !(@category || @product_category || @region || (!@query.blank?)) - # not searching, no menu - return - end +# if !(@category || @product_category || @region || (!@query.blank?)) +# # not searching, no menu +# return +# end @categories = @results[:products].map(&:product_category).compact @counts = @categories.uniq.inject({}) do |h, cat| diff --git a/test/functional/search_controller_test.rb b/test/functional/search_controller_test.rb index 6492ad7..1d32e8d 100644 --- a/test/functional/search_controller_test.rb +++ b/test/functional/search_controller_test.rb @@ -296,7 +296,6 @@ class SearchControllerTest < Test::Unit::TestCase names = { :articles => 'Articles', - :people => 'People', :enterprises => 'Enterprises', :communities => 'Communities', :products => 'Products', @@ -306,6 +305,10 @@ class SearchControllerTest < Test::Unit::TestCase assert_tag :tag => 'div', :attributes => { :class => /search-results-#{thing}/ }, :descendant => { :tag => 'h3', :content => Regexp.new(description) } assert_tag :tag => 'a', :content => "display #{thing.to_s.singularize}" end + + # display only first name on people listing + assert_tag :tag => 'div', :attributes => { :class => /search-results-people/ }, :descendant => { :tag => 'h3', :content => /People/ } + assert_tag :tag => 'a', :content => "display" end should 'present options of where to search' do -- libgit2 0.21.2