Change: サークルの送り先アカウント指定方法をaccount_username(Fedibirdと同様)に変更 (#283)

* Change: サークルの送り先アカウント指定方法を`account_username`(Fedibirdと同様)に変更

* Test: テストを追加

* Maybe Fix: Fedibirdで自分限定と認識される問題
This commit is contained in:
KMY(雪あすか) 2023-11-17 08:40:55 +09:00 committed by GitHub
parent 7742f440fa
commit 0f01a71dcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 6 deletions

View file

@ -6,7 +6,7 @@ describe ActivityPub::DistributionWorker do
subject { described_class.new }
let(:status) { Fabricate(:status) }
let(:follower) { Fabricate(:account, protocol: :activitypub, inbox_url: 'http://example.com', domain: 'example.com') }
let(:follower) { Fabricate(:account, protocol: :activitypub, shared_inbox_url: 'http://example.com', inbox_url: 'http://example.com/follower/inbox', domain: 'example.com') }
describe '#perform' do
before do
@ -25,6 +25,18 @@ describe ActivityPub::DistributionWorker do
end
end
context 'with unlisted status' do
before do
status.update(visibility: :unlisted)
end
it 'delivers to followers' do
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com', anything]]) do
subject.perform(status.id)
end
end
end
context 'with private status' do
before do
status.update(visibility: :private)
@ -37,6 +49,20 @@ describe ActivityPub::DistributionWorker do
end
end
context 'with limited status' do
before do
status.update(visibility: :limited)
status.capability_tokens.create!
status.mentions.create!(account: follower, silent: true)
end
it 'delivers to followers' do
expect_push_bulk_to_match(ActivityPub::DeliveryWorker, [[kind_of(String), status.account.id, 'http://example.com/follower/inbox', anything]]) do
subject.perform(status.id)
end
end
end
context 'with direct status' do
let(:mentioned_account) { Fabricate(:account, protocol: :activitypub, inbox_url: 'https://foo.bar/inbox', domain: 'foo.bar') }