mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
improve erraticly failing spec
This commit is contained in:
parent
8e9531657a
commit
45f65859c9
@ -91,4 +91,8 @@ class RandomTopicSelector
|
||||
"random_topic_cache_#{category&.id}"
|
||||
end
|
||||
|
||||
def self.clear_cache!
|
||||
$redis.delete_prefixed(cache_key)
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -3,7 +3,12 @@ require 'rails_helper'
|
||||
describe TopicViewSerializer do
|
||||
def serialize_topic(topic, user_arg)
|
||||
topic_view = TopicView.new(topic.id, user_arg)
|
||||
described_class.new(topic_view, scope: Guardian.new(user_arg), root: false).as_json
|
||||
TopicViewSerializer.new(topic_view, scope: Guardian.new(user_arg), root: false).as_json
|
||||
end
|
||||
|
||||
before do
|
||||
# ensure no suggested ids are cached cause that can muck up suggested
|
||||
RandomTopicSelector.clear_cache!
|
||||
end
|
||||
|
||||
let(:topic) { Fabricate(:topic) }
|
||||
|
Loading…
Reference in New Issue
Block a user