convert buyQuest (gold) to the purchase refactoring / check quantity to be a number (#10244)

This commit is contained in:
negue
2018-04-13 15:14:51 +02:00
committed by Matteo Pagliazzi
parent 8f1d241e83
commit 1109ae308d
4 changed files with 80 additions and 46 deletions
+7 -1
View File
@@ -1,7 +1,7 @@
import {
generateUser,
} from '../../../helpers/common.helper';
import buyQuest from '../../../../website/common/script/ops/buy/buyQuest';
import {BuyQuestWithGoldOperation} from '../../../../website/common/script/ops/buy/buyQuest';
import {
BadRequest,
NotAuthorized,
@@ -13,6 +13,12 @@ describe('shared.ops.buyQuest', () => {
let user;
let analytics = {track () {}};
function buyQuest (_user, _req, _analytics) {
const buyOp = new BuyQuestWithGoldOperation(_user, _req, _analytics);
return buyOp.purchase();
}
beforeEach(() => {
user = generateUser();
sinon.stub(analytics, 'track');