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