Commit 7f4b555e29dd8f16f5bc98852618dab4585b916e
1 parent
7f2dc0be
Exists in
master
and in
28 other branches
ActionItem155: adding security restriction
git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1627 3f533792-8f58-4932-b0fe-aaf55b0a4547
Showing
2 changed files
with
8 additions
and
1 deletions
Show diff stats
app/controllers/public/search_controller.rb
@@ -84,7 +84,9 @@ class SearchController < ApplicationController | @@ -84,7 +84,9 @@ class SearchController < ApplicationController | ||
84 | 84 | ||
85 | 85 | ||
86 | @results = { asset => @finder.send(asset).recent(LIST_LIMIT) } | 86 | @results = { asset => @finder.send(asset).recent(LIST_LIMIT) } |
87 | - @names = { asset => gettext(SEARCH_IN.find { |entry| entry.first == asset }[1]) } | 87 | + |
88 | + @asset_name = gettext(SEARCH_IN.find { |entry| entry.first == asset }[1]) | ||
89 | + @names = { asset => @asset_name } | ||
88 | end | 90 | end |
89 | 91 | ||
90 | def tags | 92 | def tags |
test/functional/search_controller_test.rb
@@ -431,4 +431,9 @@ class SearchControllerTest < Test::Unit::TestCase | @@ -431,4 +431,9 @@ class SearchControllerTest < Test::Unit::TestCase | ||
431 | assert_response 403 | 431 | assert_response 403 |
432 | end | 432 | end |
433 | 433 | ||
434 | + should 'expose asset name in instance variable' do | ||
435 | + get :assets, :asset => 'products' | ||
436 | + assert_equal 'Products', assigns(:asset_name) | ||
437 | + end | ||
438 | + | ||
434 | end | 439 | end |