Commit b95442c7e0b09959639dc28fbec273abaf0bf919

Authored by Joenio Costa
1 parent 645a7610

Discard view_paths added by Noosfero's plugins

(ActionItem2244)
app/helpers/application_helper.rb
@@ -1154,7 +1154,7 @@ module ApplicationHelper @@ -1154,7 +1154,7 @@ module ApplicationHelper
1154 def render_environment_features(folder) 1154 def render_environment_features(folder)
1155 result = '' 1155 result = ''
1156 environment.enabled_features.keys.each do |feature| 1156 environment.enabled_features.keys.each do |feature|
1157 - file = File.join(@controller.view_paths, 'shared', folder.to_s, "#{feature}.rhtml") 1157 + file = File.join(@controller.view_paths.last, 'shared', folder.to_s, "#{feature}.rhtml")
1158 if File.exists?(file) 1158 if File.exists?(file)
1159 result << render(:file => file, :use_full_path => false) 1159 result << render(:file => file, :use_full_path => false)
1160 end 1160 end
test/unit/application_helper_test.rb
@@ -603,7 +603,7 @@ class ApplicationHelperTest &lt; Test::Unit::TestCase @@ -603,7 +603,7 @@ class ApplicationHelperTest &lt; Test::Unit::TestCase
603 603
604 @controller = ApplicationController.new 604 @controller = ApplicationController.new
605 path = File.join(RAILS_ROOT, 'app', 'views') 605 path = File.join(RAILS_ROOT, 'app', 'views')
606 - @controller.stubs(:view_paths).returns(path) 606 + @controller.stubs(:view_paths).returns([path])
607 607
608 file = path + '/shared/usermenu/xmpp_chat.rhtml' 608 file = path + '/shared/usermenu/xmpp_chat.rhtml'
609 expects(:render).with(:file => file, :use_full_path => false).returns('Open chat') 609 expects(:render).with(:file => file, :use_full_path => false).returns('Open chat')