diff options
author | Claire <claire.github-309c@sitedethib.com> | 2021-08-08 15:29:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-08 15:29:57 +0200 |
commit | 763ab0c7eb5430235ca8a354d11e00de1d8ba6dd (patch) | |
tree | 424b1ab20882facd51ef8e1140381b6cf56e850f /spec | |
parent | 818e0b314fc81005dc9a73b53331f75ad52daa0d (diff) |
Fix owned account notes not being deleted when an account is deleted (#16579)
* Add account_notes relationship * Add tests * Fix owned account notes not being deleted when an account is deleted * Add post-migration to clean up orphaned account notes
Diffstat (limited to 'spec')
-rw-r--r-- | spec/services/delete_account_service_spec.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/spec/services/delete_account_service_spec.rb b/spec/services/delete_account_service_spec.rb index cd7d32d59..b1da97036 100644 --- a/spec/services/delete_account_service_spec.rb +++ b/spec/services/delete_account_service_spec.rb @@ -21,6 +21,8 @@ RSpec.describe DeleteAccountService, type: :service do let!(:favourite_notification) { Fabricate(:notification, account: local_follower, activity: favourite, type: :favourite) } let!(:follow_notification) { Fabricate(:notification, account: local_follower, activity: active_relationship, type: :follow) } + let!(:account_note) { Fabricate(:account_note, account: account) } + subject do -> { described_class.new.call(account) } end @@ -35,8 +37,9 @@ RSpec.describe DeleteAccountService, type: :service do account.active_relationships, account.passive_relationships, account.polls, + account.account_notes, ].map(&:count) - }.from([2, 1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0, 0]) + }.from([2, 1, 1, 1, 1, 1, 1, 1]).to([0, 0, 0, 0, 0, 0, 0, 0]) end it 'deletes associated target records' do |