Merge branch 'next-minor' into develop
This commit is contained in:
commit
4c74136c53
3 changed files with 21 additions and 2 deletions
|
|
@ -40,6 +40,7 @@ Although the chat was never enabled per default and was marked as experimental,
|
||||||
## Bug fixes
|
## Bug fixes
|
||||||
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
|
* Update comment counter when weleting a comment in the Single Post View [#7938](https://github.com/diaspora/diaspora/pull/7938)
|
||||||
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
|
* Link diaspora only poduptime list [#8174](https://github.com/diaspora/diaspora/pull/8174)
|
||||||
|
* Delete a user's invitation code during account deletion [#8202](https://github.com/diaspora/diaspora/pull/8202)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
* Support and recommend TOML as configuration format [#8132](https://github.com/diaspora/diaspora/pull/8132)
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ class AccountDeleter
|
||||||
remove_share_visibilities_on_contacts_posts
|
remove_share_visibilities_on_contacts_posts
|
||||||
disconnect_contacts
|
disconnect_contacts
|
||||||
delete_standard_user_associations
|
delete_standard_user_associations
|
||||||
|
delete_user_invitation_code
|
||||||
tombstone_user
|
tombstone_user
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -56,6 +57,10 @@ class AccountDeleter
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def delete_user_invitation_code
|
||||||
|
InvitationCode.find_by(user_id: user.id).try(:destroy)
|
||||||
|
end
|
||||||
|
|
||||||
def normal_ar_person_associates_to_delete
|
def normal_ar_person_associates_to_delete
|
||||||
%i[posts photos mentions participations roles blocks conversation_visibilities]
|
%i[posts photos mentions participations roles blocks conversation_visibilities]
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -76,6 +76,7 @@ describe AccountDeleter do
|
||||||
describe "#close_user" do
|
describe "#close_user" do
|
||||||
user_removal_methods = %i[
|
user_removal_methods = %i[
|
||||||
delete_standard_user_associations
|
delete_standard_user_associations
|
||||||
|
delete_user_invitation_code
|
||||||
remove_share_visibilities_on_contacts_posts
|
remove_share_visibilities_on_contacts_posts
|
||||||
disconnect_contacts tombstone_user
|
disconnect_contacts tombstone_user
|
||||||
]
|
]
|
||||||
|
|
@ -92,7 +93,7 @@ describe AccountDeleter do
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "#delete_standard_user_associations" do
|
describe "#delete_standard_user_associations" do
|
||||||
it 'removes all standard user associaltions' do
|
it "removes all standard user associations" do
|
||||||
@account_deletion.normal_ar_user_associates_to_delete.each do |asso|
|
@account_deletion.normal_ar_user_associates_to_delete.each do |asso|
|
||||||
association_double = double
|
association_double = double
|
||||||
expect(association_double).to receive(:ids).and_return([42])
|
expect(association_double).to receive(:ids).and_return([42])
|
||||||
|
|
@ -107,11 +108,23 @@ describe AccountDeleter do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "#delete_user_invitation_code" do
|
||||||
|
it "deletes user invitation code" do
|
||||||
|
expect(bob.invitation_code).not_to be_nil
|
||||||
|
expect(bob.invitation_code).to eq(InvitationCode.find_by(user_id: bob.id))
|
||||||
|
invitation_code_double = double
|
||||||
|
expect(InvitationCode).to receive(:find_by).with(user_id: bob.id).and_return(invitation_code_double)
|
||||||
|
expect(invitation_code_double).to receive(:destroy)
|
||||||
|
|
||||||
|
@account_deletion.delete_user_invitation_code
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
describe "#delete_standard_person_associations" do
|
describe "#delete_standard_person_associations" do
|
||||||
before do
|
before do
|
||||||
@account_deletion.person = bob.person
|
@account_deletion.person = bob.person
|
||||||
end
|
end
|
||||||
it 'removes all standard person associaltions' do
|
it "removes all standard person associations" do
|
||||||
@account_deletion.normal_ar_person_associates_to_delete.each do |asso|
|
@account_deletion.normal_ar_person_associates_to_delete.each do |asso|
|
||||||
association_double = double
|
association_double = double
|
||||||
expect(association_double).to receive(:ids).and_return([42])
|
expect(association_double).to receive(:ids).and_return([42])
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue