Commit 7f4b555e29dd8f16f5bc98852618dab4585b916e

Authored by AntonioTerceiro
1 parent 7f2dc0be

ActionItem155: adding security restriction


git-svn-id: https://svn.colivre.coop.br/svn/noosfero/trunk@1627 3f533792-8f58-4932-b0fe-aaf55b0a4547
app/controllers/public/search_controller.rb
... ... @@ -84,7 +84,9 @@ class SearchController < ApplicationController
84 84  
85 85  
86 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 90 end
89 91  
90 92 def tags
... ...
test/functional/search_controller_test.rb
... ... @@ -431,4 +431,9 @@ class SearchControllerTest < Test::Unit::TestCase
431 431 assert_response 403
432 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 439 end
... ...