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

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

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

* Test: テストを追加

* Maybe Fix: Fedibirdで自分限定と認識される問題

* Fix test
This commit is contained in:
KMY(雪あすか) 2023-11-28 12:54:03 +09:00 committed by GitHub
parent 203617edaf
commit 8383288219
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 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
@ -24,6 +24,17 @@ 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]])
subject.perform(status.id)
end
end
context 'with private status' do
before do
status.update(visibility: :private)
@ -35,6 +46,19 @@ 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]])
subject.perform(status.id)
end
end
context 'with direct status' do
let(:mentioned_account) { Fabricate(:account, protocol: :activitypub, inbox_url: 'https://foo.bar/inbox', domain: 'foo.bar') }