Fix processing of compacted single-item JSON-LD collections (#28816)

This commit is contained in:
Claire 2024-01-19 13:43:10 +01:00 committed by GitHub
parent 3593ee2e36
commit cf2a2ed71c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 51 additions and 9 deletions

View file

@ -34,6 +34,18 @@ RSpec.describe ActivityPub::FetchRepliesService, type: :service do
describe '#call' do
context 'when the payload is a Collection with inlined replies' do
context 'when there is a single reply, with the array compacted away' do
let(:items) { 'http://example.com/self-reply-1' }
it 'queues the expected worker' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, payload)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1'])
end
end
context 'when passing the collection itself' do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)