Federate activity when remote account is added to a Collection (#37992)
This commit is contained in:
1 parent
951a42f491
commit
b09e63da87
10 files changed
+156
-15
No files matched your search
@@ -16,14 +16,6 @@ RSpec.describe CollectionItem do
|
||||
it { is_expected.to validate_presence_of(:account) }
|
||||
end
|
||||
|
||||
context 'when item is local and account is remote' do
|
||||
subject { Fabricate.build(:collection_item, account: remote_account) }
|
||||
|
||||
let(:remote_account) { Fabricate.build(:remote_account) }
|
||||
|
||||
it { is_expected.to validate_presence_of(:activity_uri) }
|
||||
end
|
||||
|
||||
context 'when item is not local' do
|
||||
subject { Fabricate.build(:collection_item, collection: remote_collection) }
|
||||
|
||||
@@ -58,5 +50,11 @@ RSpec.describe CollectionItem do
|
||||
expect(unrelated_item.position).to eq 1
|
||||
expect(custom_item.position).to eq 7
|
||||
end
|
||||
|
||||
it 'automatically sets `activity_uri` when account is remote' do
|
||||
item = collection.collection_items.create(account: Fabricate(:remote_account))
|
||||
|
||||
expect(item.activity_uri).to be_present
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in new issue
Block a user