mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Set topic list filter name in serializer for children (#29291)
This commit is contained in:
@@ -14,4 +14,13 @@ RSpec.describe TopicListSerializer do
|
||||
expect(serialized[:primary_groups]).to eq([])
|
||||
expect(serialized[:topic_list][:topics].first[:id]).to eq(topic.id)
|
||||
end
|
||||
|
||||
it "adds filter name to the options hash so childrens can access it" do
|
||||
filter = :hot
|
||||
topic_list = TopicList.new(filter, user, [topic])
|
||||
|
||||
serializer = described_class.new(topic_list, scope: Guardian.new(user))
|
||||
|
||||
expect(serializer.options[:filter]).to eq(filter)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user