mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 21:02:48 +08:00
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:
parent
0f733ed56e
commit
7c8e978b54
|
@ -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 }
|
||||
|
|
Loading…
Reference in New Issue
Block a user