update tests for default false, explicitly test disabling

This commit is contained in:
sneakers-the-rat 2026-02-10 22:56:01 -08:00
parent 74a95fc118
commit 4e8f438cb8
No known key found for this signature in database
GPG Key ID: 6DCB96EF1E4D232D
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,8 @@ RSpec.describe FollowRequest do
let(:account) { Fabricate(:account) }
let(:target_account) { Fabricate(:account) }
before { stub_const('ActivityPub::AccountBackfillService::ENABLED', true) }
context 'when the to-be-followed person has been added to a list' do
let!(:list) { Fabricate(:list, account: account) }

View File

@ -49,6 +49,7 @@ RSpec.describe ActivityPub::AccountBackfillService do
before do
stub_request(:get, 'http://other.com/alice/outbox').to_return(status: 200, body: Oj.dump(outbox), headers: { 'Content-Type': 'application/activity+json' })
stub_request(:get, 'http://other.com/alice/outbox?page=true').to_return(status: 200, body: Oj.dump(outbox_page), headers: { 'Content-Type': 'application/activity+json' })
stub_const('ActivityPub::AccountBackfillService::ENABLED', true)
end
it 'fetches the items in the outbox' do
@ -108,5 +109,16 @@ RSpec.describe ActivityPub::AccountBackfillService do
expect(FetchReplyWorker).to have_received(:push_bulk).with([items[0].stringify_keys, items[1].stringify_keys])
end
end
context 'when disabled' do
before { stub_const('ActivityPub::AccountBackfillService::ENABLED', false) }
it 'does not backfill' do
allow(FetchReplyWorker).to receive(:push_bulk)
got_items = subject.call(account)
expect(got_items).to be_nil
expect(FetchReplyWorker).to_not have_received(:push_bulk)
end
end
end
end