Skip to content

A platform for community discussion. Free, open, simple.

DEV: Raise error instead of warning in testing (#22440)

Bianca Nenciu25a0c00e7211
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index d5820de91a3..c6c07482343 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -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