A platform for community discussion. Free, open, simple.
FIX: Cleanup DiscoursePluginRegistry state after tests that use it
Daniel Waterworth7f8cdea92447
diff --git a/spec/components/stylesheet/compiler_spec.rb b/spec/components/stylesheet/compiler_spec.rbindex 7443fbf6263..5191d72e967 100644--- a/spec/components/stylesheet/compiler_spec.rb+++ b/spec/components/stylesheet/compiler_spec.rb@@ -40,6 +40,7 @@ describe Stylesheet::Compiler doafter doDiscourse.plugins.popStylesheet::Importer.register_imports!+ DiscoursePluginRegistry.reset!endit "does not include theme variables in plugins" dodiff --git a/spec/components/stylesheet/manager_spec.rb b/spec/components/stylesheet/manager_spec.rbindex e7054f3b7a3..95ca08b6abb 100644--- a/spec/components/stylesheet/manager_spec.rb+++ b/spec/components/stylesheet/manager_spec.rb@@ -68,7 +68,7 @@ describe Stylesheet::Manager dodescribe 'digest' doafter do- DiscoursePluginRegistry.stylesheets.delete "fake_file"+ DiscoursePluginRegistry.reset!endit 'can correctly account for plugins in digest' dodiff --git a/spec/lib/content_security_policy_spec.rb b/spec/lib/content_security_policy_spec.rbindex df0b66a1d0b..276dcb00390 100644--- a/spec/lib/content_security_policy_spec.rb+++ b/spec/lib/content_security_policy_spec.rb@@ -4,6 +4,10 @@ require 'rails_helper'describe ContentSecurityPolicy dobefore { ContentSecurityPolicy.base_url = nil }+ after do+ DiscoursePluginRegistry.reset!+ end+describe 'report-uri' doit 'is enabled by SiteSetting' doSiteSetting.content_security_policy_collect_reports = true