DEV: allow API for list_suggested_for to exclude random (#20857)

This is needed so plugins can potentially create lists without random topics
This commit is contained in:
Sam
2023-03-28 15:52:17 +11:00
committed by GitHub
parent 3ea8df4b06
commit ddec7bf6a3
2 changed files with 7 additions and 2 deletions

View File

@ -1379,6 +1379,10 @@ RSpec.describe TopicQuery do
it "should return the new topic" do
expect(TopicQuery.new.list_suggested_for(topic).topics).to eq([new_topic])
end
it "should return the nothing when random topics excluded" do
expect(TopicQuery.new.list_suggested_for(topic, include_random: false).topics).to eq([])
end
end
context "when anonymously browsing with invisible, closed and archived" do