Fix app purchase test

This commit is contained in:
Johannes Zellner
2018-05-29 23:24:08 +02:00
parent 9eb58cdfe5
commit 9194be06c3
+7 -2
View File
@@ -125,13 +125,18 @@ describe('Appstore', function () {
});
it('can purchase an app', function (done) {
var scope = nock('http://localhost:6060')
var scope1 = nock('http://localhost:6060')
.post(`/api/v1/users/${APPSTORE_USER_ID}/cloudrons/${CLOUDRON_ID}/apps/${APP_ID}?accessToken=${APPSTORE_TOKEN}`, function () { return true; })
.reply(201, {});
var scope2 = nock('http://localhost:6060')
.get(`/api/v1/users/${APPSTORE_USER_ID}/cloudrons/${CLOUDRON_ID}/subscription?accessToken=${APPSTORE_TOKEN}`, function () { return true; })
.reply(200, { subscription: { id: 'basic' }});
appstore.purchase(APP_ID, APPSTORE_APP_ID, function (error) {
expect(error).to.not.be.ok();
expect(scope.isDone()).to.be.ok();
expect(scope1.isDone()).to.be.ok();
expect(scope2.isDone()).to.be.ok();
done();
});