mirror of
https://github.com/discourse/discourse.git
synced 2025-02-20 13:49:29 +08:00
DEV: Raise error instead of warning in testing (#22440)
Some plugins call require_plugin with a wrong argument instead of the plugin name. In a production environment that used to be a warning, but there is no reason to keep it like that in a testing environment because the issue will continue to be ignored.
This commit is contained in:
parent
2dfeb5f0c2
commit
25a0c00e72
|
@ -348,6 +348,8 @@ class ApplicationController < ActionController::Base
|
|||
before_action do
|
||||
if plugin = Discourse.plugins_by_name[plugin_name]
|
||||
raise PluginDisabled.new if !plugin.enabled?
|
||||
elsif Rails.env.test?
|
||||
raise "Required plugin '#{plugin_name}' not found. The string passed to requires_plugin should match the plugin's name at the top of plugin.rb"
|
||||
else
|
||||
Rails.logger.warn("Required plugin '#{plugin_name}' not found")
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user