DEV: Fix state leak in spec (#29135)

`GlobalSetting.skip_redis` sets a class instance variable so we need
to reset it.

Follow-up to 7d441e3782
This commit is contained in:
Alan Guo Xiang Tan 2024-10-09 06:36:47 +08:00 committed by GitHub
parent 2099c33fa7
commit a243d1d6a1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

@ -55,6 +55,8 @@ RSpec.describe GlobalSetting do
Discourse.stubs(:redis).returns(nil)
end
after { GlobalSetting.skip_redis = false }
it "generates a new random key in memory without redis" do
GlobalSetting.reset_secret_key_base!
token = GlobalSetting.safe_secret_key_base