mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:01:20 +08:00
FIX: Avoid publishing a gigantic payload.
* Certain sites have way too many categories.
This commit is contained in:
@ -539,6 +539,20 @@ describe Group do
|
||||
expect(message.data[:categories].first[:id]).to eq(category.id)
|
||||
expect(message.user_ids).to eq([user.id])
|
||||
end
|
||||
|
||||
describe "when group belongs to more than #{Group::PUBLISH_CATEGORIES_LIMIT} categories" do
|
||||
it "should publish a message to refresh the user's client" do
|
||||
(Group::PUBLISH_CATEGORIES_LIMIT + 1).times do
|
||||
group.categories << Fabricate(:category)
|
||||
end
|
||||
|
||||
message = MessageBus.track_publish { group.add(user) }.first
|
||||
|
||||
expect(message.data).to eq('clobber')
|
||||
expect(message.channel).to eq('/refresh_client')
|
||||
expect(message.user_ids).to eq([user.id])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user