Adjust iap test

This commit is contained in:
Phillip Thelen
2015-10-15 00:09:24 +02:00
parent 319c294354
commit 4835de55a8
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -155,7 +155,7 @@ describe 'In-App Purchases', ->
inApp.iosVerify(req, res, next)
expect(paymentSpy).to.be.calledOnce
expect(paymentSpy).to.be.calledWith({user: res.locals.user, paymentMethod:'IAP AppleStore'})
expect(paymentSpy).to.be.calledWith({user: res.locals.user, paymentMethod:'IAP AppleStore', amount: 5.25})
context 'error in setup', ->
before ->
+1 -3
View File
@@ -104,15 +104,13 @@ exports.iosVerify = function(req, res, next) {
var correctReceipt = true;
for (var index in purchaseDataList) {
switch (purchaseDataList[index].productId) {
case 'com.habitrpg.ios.Habitica.20gems':
payments.buyGems({user:user, paymentMethod:'IAP AppleStore', amount: 5});
break;
case 'com.habitrpg.ios.Habitica.4gems':
payments.buyGems({user:user, paymentMethod:'IAP AppleStore', amount: 1});
break;
case 'com.habitrpg.ios.Habitica.8gems':
payments.buyGems({user:user, paymentMethod:'IAP AppleStore', amount: 2});
break;
case 'com.habitrpg.ios.Habitica.20gems':
case 'com.habitrpg.ios.Habitica.21gems':
payments.buyGems({user:user, paymentMethod:'IAP AppleStore', amount: 5.25});
break;