FIX: pass empty hash for view locals by default (#16879)

DEV: enable plugin tests for server_plugin_outlet
This commit is contained in:
Arpit Jalan 2022-05-20 13:34:43 +05:30 committed by GitHub
parent 4b63cd3848
commit e8e9754a3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -449,10 +449,7 @@ module ApplicationHelper
@all_connectors = Dir.glob("plugins/*/app/views/connectors/**/*.html.erb")
end
def server_plugin_outlet(name, locals: nil)
# Don't evaluate plugins in test
return "" if Rails.env.test?
def server_plugin_outlet(name, locals: {})
matcher = Regexp.new("/connectors/#{name}/.*\.html\.erb$")
erbs = ApplicationHelper.all_connectors.select { |c| c =~ matcher }
return "" if erbs.blank?