diff --git a/services/web/app/coffee/Features/User/UserDeleter.coffee b/services/web/app/coffee/Features/User/UserDeleter.coffee index 7361c7ab56..a74d0f8182 100644 --- a/services/web/app/coffee/Features/User/UserDeleter.coffee +++ b/services/web/app/coffee/Features/User/UserDeleter.coffee @@ -21,7 +21,7 @@ module.exports = (cb)-> ProjectDeleter.deleteUsersProjects user._id, cb (cb)-> - SubscriptionHandler.cancelSubscription user._id, cb + SubscriptionHandler.cancelSubscription user, cb (cb)-> user.remove cb ], (err)-> diff --git a/services/web/test/UnitTests/coffee/User/UserDeleterTests.coffee b/services/web/test/UnitTests/coffee/User/UserDeleterTests.coffee index 34fabda11c..8f3f0c3f51 100644 --- a/services/web/test/UnitTests/coffee/User/UserDeleterTests.coffee +++ b/services/web/test/UnitTests/coffee/User/UserDeleterTests.coffee @@ -49,5 +49,5 @@ describe "UserDeleter", -> it "should unsubscribe the user", (done)-> @UserDeleter.deleteUser @user._id, (err)=> - @SubscriptionHandler.cancelSubscription.calledWith(@user._id).should.equal true + @SubscriptionHandler.cancelSubscription.calledWith(@user).should.equal true done()