Do not auto-accept remote collection items (#38386)
This commit is contained in:
1 parent
7583d07d3a
commit
84ea8334fe
4 files changed
+13
-7
No files matched your search
@@ -32,9 +32,12 @@ RSpec.describe AddAccountToCollectionService do
|
||||
context 'when the account is remote', feature: :collections_federation do
|
||||
let(:account) { Fabricate(:remote_account, feature_approval_policy: (0b10 << 16)) }
|
||||
|
||||
it 'federates a `FeatureRequest` activity' do
|
||||
it 'marks the item as `pending` and federates a `FeatureRequest` activity' do
|
||||
subject.call(collection, account)
|
||||
|
||||
new_item = collection.collection_items.last
|
||||
expect(new_item).to be_pending
|
||||
|
||||
expect(ActivityPub::FeatureRequestWorker).to have_enqueued_sidekiq_job
|
||||
end
|
||||
end
|
||||
|
||||
@@ -65,9 +65,13 @@ RSpec.describe CreateCollectionService do
|
||||
context 'when some accounts are remote' do
|
||||
let(:accounts) { Fabricate.times(2, :remote_account, feature_approval_policy: (0b10 << 16)) }
|
||||
|
||||
it 'federates `FeatureRequest` activities', feature: :collections_federation do
|
||||
it 'marks the new items as `pending` and federates `FeatureRequest` activities', feature: :collections_federation do
|
||||
subject.call(params, author)
|
||||
|
||||
new_collection = author.collections.last
|
||||
expect(new_collection.collection_items.size).to eq 2
|
||||
expect(new_collection.collection_items).to all(be_pending)
|
||||
|
||||
expect(ActivityPub::FeatureRequestWorker).to have_enqueued_sidekiq_job.exactly(2).times
|
||||
end
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user