diff --git a/test/api/unit/libs/payments/apple.test.js b/test/api/unit/libs/payments/apple.test.js index 31bacfa524..8b154df0bc 100644 --- a/test/api/unit/libs/payments/apple.test.js +++ b/test/api/unit/libs/payments/apple.test.js @@ -438,6 +438,8 @@ describe('Apple Payments', () => { }); it('errors when a user is using a rebill of the same subscription', async () => { + user = new User(); + await user.save(); payments.createSubscription.restore(); iap.getPurchaseData.restore(); iapGetPurchaseDataStub = sinon.stub(iap, 'getPurchaseData') @@ -459,6 +461,8 @@ describe('Apple Payments', () => { }); it('errors when a different user is using the subscription', async () => { + user = new User(); + await user.save(); payments.createSubscription.restore(); iap.getPurchaseData.restore(); iapGetPurchaseDataStub = sinon.stub(iap, 'getPurchaseData')