mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: pass empty hash for view locals by default (#16879)
DEV: enable plugin tests for server_plugin_outlet
This commit is contained in:
@@ -449,10 +449,7 @@ module ApplicationHelper
|
|||||||
@all_connectors = Dir.glob("plugins/*/app/views/connectors/**/*.html.erb")
|
@all_connectors = Dir.glob("plugins/*/app/views/connectors/**/*.html.erb")
|
||||||
end
|
end
|
||||||
|
|
||||||
def server_plugin_outlet(name, locals: nil)
|
def server_plugin_outlet(name, locals: {})
|
||||||
# Don't evaluate plugins in test
|
|
||||||
return "" if Rails.env.test?
|
|
||||||
|
|
||||||
matcher = Regexp.new("/connectors/#{name}/.*\.html\.erb$")
|
matcher = Regexp.new("/connectors/#{name}/.*\.html\.erb$")
|
||||||
erbs = ApplicationHelper.all_connectors.select { |c| c =~ matcher }
|
erbs = ApplicationHelper.all_connectors.select { |c| c =~ matcher }
|
||||||
return "" if erbs.blank?
|
return "" if erbs.blank?
|
||||||
|
|||||||
Reference in New Issue
Block a user