From d577a2b82eb79d13ba3b15eb815c7376ebe3786d Mon Sep 17 00:00:00 2001 From: kikito Date: Tue, 19 Apr 2016 12:07:20 +0200 Subject: [PATCH] add spec for user identity erasure --- spec/models/user_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 4d1b269ec..b49e3cc6b 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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