0
0
Fork 0

Add notifications of severed relationships (#27511)

This commit is contained in:
Claire 2024-03-20 16:37:21 +01:00 committed by GitHub
parent 8a1423a474
commit 44bf7b8128
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
39 changed files with 781 additions and 54 deletions

View file

@ -59,7 +59,7 @@ RSpec.describe SuspendAccountService, :sidekiq_inline do
remote_follower.follow!(account)
end
it 'sends an update actor to followers and reporters' do
it 'sends an Update actor activity to followers and reporters' do
subject
expect(a_request(:post, remote_follower.inbox_url).with { |req| match_update_actor_request(req, account) }).to have_been_made.once
expect(a_request(:post, remote_reporter.inbox_url).with { |req| match_update_actor_request(req, account) }).to have_been_made.once
@ -85,9 +85,14 @@ RSpec.describe SuspendAccountService, :sidekiq_inline do
account.follow!(local_followee)
end
it 'sends a reject follow' do
it 'sends a Reject Follow activity, and records severed relationships', :aggregate_failures do
subject
expect(a_request(:post, account.inbox_url).with { |req| match_reject_follow_request(req, account, local_followee) }).to have_been_made.once
severed_relationships = local_followee.severed_relationships.to_a
expect(severed_relationships.count).to eq 1
expect(severed_relationships.map { |rel| [rel.account, rel.target_account] }).to contain_exactly([account, local_followee])
end
end
end