diff --git a/src/test/appstore-test.js b/src/test/appstore-test.js index 4d6e7f2ab..a2225ef0f 100644 --- a/src/test/appstore-test.js +++ b/src/test/appstore-test.js @@ -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(); });