Add: Update root status when fetching replies (#34615)
This commit is contained in:
parent
4e2aa78a56
commit
b709ef8ac3
3 changed files with 35 additions and 9 deletions
|
@ -125,6 +125,7 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
|
|||
before do
|
||||
stub_const('Status::FetchRepliesConcern::FETCH_REPLIES_ENABLED', true)
|
||||
allow(FetchReplyWorker).to receive(:push_bulk)
|
||||
allow(FetchReplyWorker).to receive(:perform_async)
|
||||
all_items.each do |item|
|
||||
next if [top_note_uri, reply_note_uri].include? item
|
||||
|
||||
|
@ -146,6 +147,12 @@ RSpec.describe ActivityPub::FetchAllRepliesWorker do
|
|||
got_uris = subject.perform(status.id)
|
||||
expect(got_uris).to match_array(top_items + top_items_paged)
|
||||
end
|
||||
|
||||
it 'fetches the top status only once' do
|
||||
_ = subject.perform(status.id, { request_id: 0 })
|
||||
expect(FetchReplyWorker).to have_received(:perform_async).with(top_note_uri, { prefetched_body: top_object.deep_stringify_keys, request_id: 0 })
|
||||
expect(a_request(:get, top_note_uri)).to have_been_made.once
|
||||
end
|
||||
end
|
||||
|
||||
describe 'perform' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue