add spec for user identity erasure
This commit is contained in:
@@ -333,6 +333,7 @@ describe User do
|
||||
email_verification_token: "token3",
|
||||
confirmed_phone:"5678",
|
||||
unconfirmed_phone:"5678")
|
||||
|
||||
user.erase('a test')
|
||||
user.reload
|
||||
|
||||
@@ -353,6 +354,14 @@ describe User do
|
||||
expect(user.confirmation_token).to be_nil
|
||||
expect(user.reset_password_token).to be_nil
|
||||
expect(user.email_verification_token).to be_nil
|
||||
|
||||
end
|
||||
|
||||
it "destroys associated identities" do
|
||||
user = create(:user)
|
||||
identity = create(:identity, user: user)
|
||||
user.erase('an identity test')
|
||||
expect(Identity.exists?(identity.id)).to_not be
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user