DEV: Fix group of tests that is leaking state (#23141)

The test group was only clearing the cache in a `before` block which
means it still leaks the state at the end of each test.
This commit is contained in:
Alan Guo Xiang Tan 2023-08-18 13:47:09 +08:00 committed by GitHub
parent 0f733ed56e
commit 7c8e978b54
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -1366,12 +1366,12 @@ RSpec.describe TopicQuery do
end
describe "#list_suggested_for" do
use_redis_snapshotting
def clear_cache!
Discourse.redis.keys("random_topic_cache*").each { |k| Discourse.redis.del k }
end
before { clear_cache! }
context "when anonymous" do
let(:topic) { Fabricate(:topic) }
let!(:new_topic) { Fabricate(:post, user: creator).topic }