Fix streamed quoted polls not being hydrated correctly (#37118)

This commit is contained in:
Claire
2025-12-04 15:10:48 +01:00
committed by GitHub
parent 9921fa1af7
commit 88aed3c11a
2 changed files with 40 additions and 19 deletions

View File

@@ -176,6 +176,28 @@ RSpec.describe StatusCacheHydrator do
end
end
context 'when the quoted post has a poll authored by the user' do
let(:poll) { Fabricate(:poll, account: account) }
let(:quoted_status) { Fabricate(:status, poll: poll, account: account) }
it 'renders the same attributes as a full render' do
expect(subject).to eql(compare_to_hash)
end
end
context 'when the quoted post has been voted in' do
let(:poll) { Fabricate(:poll, options: %w(Yellow Blue)) }
let(:quoted_status) { Fabricate(:status, poll: poll) }
before do
VoteService.new.call(account, poll, [0])
end
it 'renders the same attributes as a full render' do
expect(subject).to eql(compare_to_hash)
end
end
context 'when the quoted post matches account filters' do
let(:quoted_status) { Fabricate(:status, text: 'this toot is about that banned word') }