Skip to content

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

DEV: Fix the `enable_current_plugin` spec helper

Loïc Guitautc96e7aa723db
diff --git a/spec/support/helpers.rb b/spec/support/helpers.rb
index ee345027b31..43682427419 100644
--- a/spec/support/helpers.rb
+++ b/spec/support/helpers.rb
@@ -309,9 +309,9 @@ module Helpers
end
def enable_current_plugin
- setting_name =
- Discourse.plugins_by_name[directory_from_caller.split("/").last].enabled_site_setting
- SiteSetting.public_send("#{setting_name}=", true)
+ plugin = Discourse.plugins_by_name[directory_from_caller.split("/").last]
+ return if plugin.enabled?
+ SiteSetting.public_send("#{plugin.enabled_site_setting}=", true)
end
private