|
@ -18,7 +18,6 @@ RSpec.describe SuspendAccountService, type: :service do |
|
|
let!(:favourite) { Fabricate(:favourite, account: account) } |
|
|
let!(:favourite) { Fabricate(:favourite, account: account) } |
|
|
let!(:active_relationship) { Fabricate(:follow, account: account) } |
|
|
let!(:active_relationship) { Fabricate(:follow, account: account) } |
|
|
let!(:passive_relationship) { Fabricate(:follow, target_account: account) } |
|
|
let!(:passive_relationship) { Fabricate(:follow, target_account: account) } |
|
|
let!(:subscription) { Fabricate(:subscription, account: account) } |
|
|
|
|
|
let!(:remote_alice) { Fabricate(:account, inbox_url: 'https://alice.com/inbox', protocol: :activitypub) } |
|
|
let!(:remote_alice) { Fabricate(:account, inbox_url: 'https://alice.com/inbox', protocol: :activitypub) } |
|
|
let!(:remote_bob) { Fabricate(:account, inbox_url: 'https://bob.com/inbox', protocol: :activitypub) } |
|
|
let!(:remote_bob) { Fabricate(:account, inbox_url: 'https://bob.com/inbox', protocol: :activitypub) } |
|
|
|
|
|
|
|
@ -31,9 +30,8 @@ RSpec.describe SuspendAccountService, type: :service do |
|
|
account.favourites, |
|
|
account.favourites, |
|
|
account.active_relationships, |
|
|
account.active_relationships, |
|
|
account.passive_relationships, |
|
|
account.passive_relationships, |
|
|
account.subscriptions |
|
|
|
|
|
].map(&:count) |
|
|
].map(&:count) |
|
|
}.from([1, 1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0, 0]) |
|
|
|
|
|
|
|
|
}.from([1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0]) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
it 'sends a delete actor activity to all known inboxes' do |
|
|
it 'sends a delete actor activity to all known inboxes' do |
|
@ -62,7 +60,6 @@ RSpec.describe SuspendAccountService, type: :service do |
|
|
let!(:favourite) { Fabricate(:favourite, account: remote_bob) } |
|
|
let!(:favourite) { Fabricate(:favourite, account: remote_bob) } |
|
|
let!(:active_relationship) { Fabricate(:follow, account: remote_bob, target_account: account) } |
|
|
let!(:active_relationship) { Fabricate(:follow, account: remote_bob, target_account: account) } |
|
|
let!(:passive_relationship) { Fabricate(:follow, target_account: remote_bob) } |
|
|
let!(:passive_relationship) { Fabricate(:follow, target_account: remote_bob) } |
|
|
let!(:subscription) { Fabricate(:subscription, account: remote_bob) } |
|
|
|
|
|
|
|
|
|
|
|
it 'deletes associated records' do |
|
|
it 'deletes associated records' do |
|
|
is_expected.to change { |
|
|
is_expected.to change { |
|
@ -73,9 +70,8 @@ RSpec.describe SuspendAccountService, type: :service do |
|
|
remote_bob.favourites, |
|
|
remote_bob.favourites, |
|
|
remote_bob.active_relationships, |
|
|
remote_bob.active_relationships, |
|
|
remote_bob.passive_relationships, |
|
|
remote_bob.passive_relationships, |
|
|
remote_bob.subscriptions |
|
|
|
|
|
].map(&:count) |
|
|
].map(&:count) |
|
|
}.from([1, 1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0, 0]) |
|
|
|
|
|
|
|
|
}.from([1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0]) |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
it 'sends a reject follow to follwer inboxes' do |
|
|
it 'sends a reject follow to follwer inboxes' do |
|
|