From d6e22eff2bc833af0224342e510e457d66111f73 Mon Sep 17 00:00:00 2001 From: Victor Costa Date: Wed, 29 Jan 2014 13:05:21 -0300 Subject: [PATCH] rails3: fix public_path from plugins --- lib/noosfero/plugin.rb | 2 +- test/functional/application_controller_test.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/noosfero/plugin.rb b/lib/noosfero/plugin.rb index 3ce8072..93d4ea4 100644 --- a/lib/noosfero/plugin.rb +++ b/lib/noosfero/plugin.rb @@ -107,7 +107,7 @@ class Noosfero::Plugin end def public_path(file = '') - compute_public_path((public_name + '/' + file), 'plugins') + File.join('/plugins', public_name, file) end def root_path diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index ef7e8fc..6c3df3d 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -360,6 +360,9 @@ class ApplicationControllerTest < ActionController::TestCase environment.enable_plugin(Plugin1.name) environment.enable_plugin(Plugin2.name) + ActionView::Helpers::AssetTagHelper::StylesheetIncludeTag.any_instance.stubs('asset_file_path!') + ActionView::Helpers::AssetTagHelper::JavascriptIncludeTag.any_instance.stubs('asset_file_path!') + get :index assert_tag :tag => 'link', :attributes => {:href => /#{plugin1_path}/, :type => 'text/css', :rel => 'stylesheet'} @@ -391,6 +394,8 @@ class ApplicationControllerTest < ActionController::TestCase environment.enable_plugin(Plugin1.name) environment.enable_plugin(Plugin2.name) + ActionView::Helpers::AssetTagHelper::JavascriptIncludeTag.any_instance.stubs('asset_file_path!') + get :index assert_tag :tag => 'script', :attributes => {:src => /#{plugin1_path}/, :type => 'text/javascript'} -- libgit2 0.21.2