mirror of
https://github.com/discourse/discourse.git
synced 2025-05-25 08:41:25 +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:

committed by
GitHub

parent
0f733ed56e
commit
7c8e978b54
@ -1366,12 +1366,12 @@ RSpec.describe TopicQuery do
|
|||||||
end
|
end
|
||||||
|
|
||||||
describe "#list_suggested_for" do
|
describe "#list_suggested_for" do
|
||||||
|
use_redis_snapshotting
|
||||||
|
|
||||||
def clear_cache!
|
def clear_cache!
|
||||||
Discourse.redis.keys("random_topic_cache*").each { |k| Discourse.redis.del k }
|
Discourse.redis.keys("random_topic_cache*").each { |k| Discourse.redis.del k }
|
||||||
end
|
end
|
||||||
|
|
||||||
before { clear_cache! }
|
|
||||||
|
|
||||||
context "when anonymous" do
|
context "when anonymous" do
|
||||||
let(:topic) { Fabricate(:topic) }
|
let(:topic) { Fabricate(:topic) }
|
||||||
let!(:new_topic) { Fabricate(:post, user: creator).topic }
|
let!(:new_topic) { Fabricate(:post, user: creator).topic }
|
||||||
|
Reference in New Issue
Block a user