Commit 8b957e61532b0140b038ff6825a1a181f4177067
1 parent
f50d08de
Exists in
master
and in
22 other branches
ActionItem489: fixing test for listing person with first name only
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@2102 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
11 additions
and
6 deletions
Show diff stats
app/controllers/public/search_controller.rb
| ... | ... | @@ -118,7 +118,9 @@ class SearchController < ApplicationController |
| 118 | 118 | number_of_result_assets = @searching.values.select{|v| v}.size |
| 119 | 119 | |
| 120 | 120 | # apply limit when searching for only one type of asset |
| 121 | - limit = (number_of_result_assets == 1) ? LIST_LIMIT : nil | |
| 121 | +# limit = (number_of_result_assets == 1) ? LIST_LIMIT : nil | |
| 122 | + # apply limit to all searches | |
| 123 | + limit = nil | |
| 122 | 124 | |
| 123 | 125 | @results = {} |
| 124 | 126 | @names = {} |
| ... | ... | @@ -148,10 +150,10 @@ class SearchController < ApplicationController |
| 148 | 150 | |
| 149 | 151 | def products |
| 150 | 152 | @results[:products].uniq! |
| 151 | - if !(@category || @product_category || @region || (!@query.blank?)) | |
| 152 | - # not searching, no menu | |
| 153 | - return | |
| 154 | - end | |
| 153 | +# if !(@category || @product_category || @region || (!@query.blank?)) | |
| 154 | +# # not searching, no menu | |
| 155 | +# return | |
| 156 | +# end | |
| 155 | 157 | |
| 156 | 158 | @categories = @results[:products].map(&:product_category).compact |
| 157 | 159 | @counts = @categories.uniq.inject({}) do |h, cat| | ... | ... |
test/functional/search_controller_test.rb
| ... | ... | @@ -296,7 +296,6 @@ class SearchControllerTest < Test::Unit::TestCase |
| 296 | 296 | |
| 297 | 297 | names = { |
| 298 | 298 | :articles => 'Articles', |
| 299 | - :people => 'People', | |
| 300 | 299 | :enterprises => 'Enterprises', |
| 301 | 300 | :communities => 'Communities', |
| 302 | 301 | :products => 'Products', |
| ... | ... | @@ -306,6 +305,10 @@ class SearchControllerTest < Test::Unit::TestCase |
| 306 | 305 | assert_tag :tag => 'div', :attributes => { :class => /search-results-#{thing}/ }, :descendant => { :tag => 'h3', :content => Regexp.new(description) } |
| 307 | 306 | assert_tag :tag => 'a', :content => "display #{thing.to_s.singularize}" |
| 308 | 307 | end |
| 308 | + | |
| 309 | + # display only first name on people listing | |
| 310 | + assert_tag :tag => 'div', :attributes => { :class => /search-results-people/ }, :descendant => { :tag => 'h3', :content => /People/ } | |
| 311 | + assert_tag :tag => 'a', :content => "display" | |
| 309 | 312 | end |
| 310 | 313 | |
| 311 | 314 | should 'present options of where to search' do | ... | ... |