TopicView/PostSerializer should be able to handle topics without categories

This commit is contained in:
jbrw
2020-07-28 19:06:55 -04:00
parent 150e83d2a6
commit 8f140b8903
2 changed files with 21 additions and 1 deletions

View File

@@ -379,4 +379,24 @@ describe TopicViewSerializer do
end
end
context "viewing private messages when enable_category_group_moderation is enabled" do
fab!(:pm_topic) do
Fabricate(:private_message_topic, topic_allowed_users: [
Fabricate.build(:topic_allowed_user, user: user),
Fabricate.build(:topic_allowed_user, user: admin)
])
end
fab!(:post) { Fabricate(:post, topic: pm_topic) }
before do
SiteSetting.enable_category_group_moderation = true
end
# Ensure having enable_category_group_moderation turned on doesn't break private messages
it "should return posts" do
json = serialize_topic(pm_topic, user)
expect(json[:post_stream][:posts]).to be_present
end
end
end