2
0

Experimental Async Refreshes API (#34918)

This commit is contained in:
David Roetzel
2025-06-12 16:54:00 +02:00
committed by GitHub
parent 825312d4b0
commit 319fbbbfac
11 changed files with 437 additions and 13 deletions

View File

@@ -66,7 +66,8 @@ RSpec.describe 'Home', :inline_jobs do
end
context 'when the timeline is regenerating' do
let(:timeline) { instance_double(HomeFeed, regenerating?: true, get: []) }
let(:async_refresh) { AsyncRefresh.create("account:#{user.account_id}:regeneration") }
let(:timeline) { instance_double(HomeFeed, regenerating?: true, get: [], async_refresh:) }
before do
allow(HomeFeed).to receive(:new).and_return(timeline)
@@ -76,6 +77,7 @@ RSpec.describe 'Home', :inline_jobs do
subject
expect(response).to have_http_status(206)
expect(response.headers['Mastodon-Async-Refresh']).to eq "id=\"#{async_refresh.id}\", retry=5"
expect(response.content_type)
.to start_with('application/json')
end