0
0
Fork 0

Refactor ActivityPub::FetchRepliesService and ActivityPub::FetchAllRepliesService (#34149)

This commit is contained in:
Claire 2025-03-12 12:52:38 +01:00 committed by GitHub
parent 9db26db495
commit 966b816382
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 95 additions and 81 deletions

View file

@ -40,7 +40,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'queues the expected worker' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, payload)
subject.call(status.account.uri, payload)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1'])
end
@ -50,7 +50,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, payload)
subject.call(status.account.uri, payload)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end
@ -64,7 +64,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, collection_uri)
subject.call(status.account.uri, collection_uri)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end
@ -85,7 +85,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, payload)
subject.call(status.account.uri, payload)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end
@ -99,7 +99,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, collection_uri)
subject.call(status.account.uri, collection_uri)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end
@ -124,7 +124,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, payload)
subject.call(status.account.uri, payload)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end
@ -138,7 +138,7 @@ RSpec.describe ActivityPub::FetchRepliesService do
it 'spawns workers for up to 5 replies on the same server' do
allow(FetchReplyWorker).to receive(:push_bulk)
subject.call(status, collection_uri)
subject.call(status.account.uri, collection_uri)
expect(FetchReplyWorker).to have_received(:push_bulk).with(['http://example.com/self-reply-1', 'http://example.com/self-reply-2', 'http://example.com/self-reply-3', 'http://example.com/self-reply-4', 'http://example.com/self-reply-5'])
end