mirror of
https://github.com/mastodon/mastodon.git
synced 2026-04-24 15:18:46 -05:00
update tests for default false, explicitly test disabling
This commit is contained in:
parent
74a95fc118
commit
4e8f438cb8
|
|
@ -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) }
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user