From b95442c7e0b09959639dc28fbec273abaf0bf919 Mon Sep 17 00:00:00 2001 From: Joenio Costa Date: Wed, 18 Jan 2012 18:01:49 -0200 Subject: [PATCH] Discard view_paths added by Noosfero's plugins --- app/helpers/application_helper.rb | 2 +- test/unit/application_helper_test.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c01e06a..fd6069f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1154,7 +1154,7 @@ module ApplicationHelper def render_environment_features(folder) result = '' environment.enabled_features.keys.each do |feature| - file = File.join(@controller.view_paths, 'shared', folder.to_s, "#{feature}.rhtml") + file = File.join(@controller.view_paths.last, 'shared', folder.to_s, "#{feature}.rhtml") if File.exists?(file) result << render(:file => file, :use_full_path => false) end diff --git a/test/unit/application_helper_test.rb b/test/unit/application_helper_test.rb index 7ba4807..a4a6e43 100644 --- a/test/unit/application_helper_test.rb +++ b/test/unit/application_helper_test.rb @@ -603,7 +603,7 @@ class ApplicationHelperTest < Test::Unit::TestCase @controller = ApplicationController.new path = File.join(RAILS_ROOT, 'app', 'views') - @controller.stubs(:view_paths).returns(path) + @controller.stubs(:view_paths).returns([path]) file = path + '/shared/usermenu/xmpp_chat.rhtml' expects(:render).with(:file => file, :use_full_path => false).returns('Open chat') -- libgit2 0.21.2