Commit 69f8cd9fa75b852a1abbf2e3dc34980569ce2a1b
1 parent
6ae99cef
Exists in
staging
and in
42 other branches
Do not display templates in new profile listings
(ActionItem1588)
Showing
2 changed files
with
16 additions
and
2 deletions
Show diff stats
app/controllers/public/browse_controller.rb
| ... | ... | @@ -12,7 +12,7 @@ class BrowseController < PublicController |
| 12 | 12 | @filter = filter |
| 13 | 13 | @title = self.filter_description(params[:action] + '_' + @filter ) |
| 14 | 14 | |
| 15 | - @results = @environment.people.send(@filter) | |
| 15 | + @results = @environment.people.visible.send(@filter) | |
| 16 | 16 | |
| 17 | 17 | if params[:query].blank? |
| 18 | 18 | @results = @results.paginate(:per_page => 27, :page => params[:page]) |
| ... | ... | @@ -25,7 +25,7 @@ class BrowseController < PublicController |
| 25 | 25 | @filter = filter |
| 26 | 26 | @title = self.filter_description(params[:action] + '_' + @filter ) |
| 27 | 27 | |
| 28 | - @results = @environment.communities.send(@filter) | |
| 28 | + @results = @environment.communities.visible.send(@filter) | |
| 29 | 29 | |
| 30 | 30 | if params[:query].blank? |
| 31 | 31 | @results = @results.paginate(:per_page => 27, :page => params[:page]) | ... | ... |
test/functional/browse_controller_test.rb
| ... | ... | @@ -218,4 +218,18 @@ class BrowseControllerTest < Test::Unit::TestCase |
| 218 | 218 | assert_tag :h1, :content => 'More recent communities' |
| 219 | 219 | end |
| 220 | 220 | |
| 221 | + should "only include visible people in more_recent filter" do | |
| 222 | + # assuming that all filters behave the same! | |
| 223 | + p1 = fast_create(Person, :visible => false) | |
| 224 | + get :people, :filter => 'more_recent' | |
| 225 | + assert_not_includes assigns(:results), p1 | |
| 226 | + end | |
| 227 | + | |
| 228 | + should "only include visible communities in more_recent filter" do | |
| 229 | + # assuming that all filters behave the same! | |
| 230 | + p1 = fast_create(Community, :visible => false) | |
| 231 | + get :communities, :filter => 'more_recent' | |
| 232 | + assert_not_includes assigns(:results), p1 | |
| 233 | + end | |
| 234 | + | |
| 221 | 235 | end | ... | ... |