Change: #375 投稿を編集して拡張ドメインブロックの条件にひっかかる状態になった場合、対象サーバーには投稿削除のActivityを送信する (#495)

* Change: #375 投稿を編集して拡張ドメインブロックの条件にひっかかる状態になった場合、対象サーバーには投稿削除のActivityを送信する

* Fix test

* Add test
This commit is contained in:
KMY(雪あすか) 2024-01-24 09:03:24 +09:00 committed by GitHub
parent e4375143ca
commit fcd13a6474
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 146 additions and 12 deletions

View file

@ -117,6 +117,33 @@ RSpec.describe ActivityPub::Activity::Update do
end
end
context 'when the status is not existing' do
let(:json) do
{
'@context': 'https://www.w3.org/ns/activitystreams',
id: 'foo',
type: 'Update',
actor: sender.uri,
signature: 'foo',
object: {
type: 'Note',
id: 'https://example.com/note',
content: 'Ohagi is tsubuan',
},
}.with_indifferent_access
end
before do
stub_request(:post, 'https://example.com/inbox').to_return(status: 200)
subject.perform
end
it 'does not create a new status', :sidekiq_inline do
status = Status.find_by(uri: 'https://example.com/note')
expect(status).to be_nil
end
end
context 'when the status is limited post and has conversation' do
let(:status) { Fabricate(:status, visibility: :limited, account: sender, uri: 'https://example.com/note', text: 'Ohagi is koshian') }
let(:conversation) { Fabricate(:conversation, ancestor_status: status) }