From 968432eaa7d81e326c0b97e5848c6d5ec2e11715 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Tue, 26 Apr 2016 10:11:03 -0700 Subject: [PATCH] use domain name in populateAddons and checkAddons (for alt domain) --- cloudron.js | 8 ++++---- test/alt-domain-test.js | 4 ++-- test/app-flow-test.js | 4 ++-- test/cloudron-backup-test.js | 4 ++-- test/cloudron-update-ams3-test.js | 4 ++-- test/cloudron-update-sfo1-test.js | 4 ++-- test/custom-domain-test.js | 4 ++-- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cloudron.js b/cloudron.js index b66bb9a..044348e 100644 --- a/cloudron.js +++ b/cloudron.js @@ -411,8 +411,8 @@ Cloudron.prototype.checkDMARC = function (callback) { }); }; -Cloudron.prototype.populateAddons = function (location) { - var res = request.post('https://' + this.appFqdn(location) + '/populate_addons').end(); +Cloudron.prototype.populateAddons = function (domain) { + var res = request.post('https://' + domain + '/populate_addons').end(); assert.strictEqual(res.statusCode, 200); for (var addon in res.body) { @@ -420,12 +420,12 @@ Cloudron.prototype.populateAddons = function (location) { } }; -Cloudron.prototype.checkAddons = function (location, owner) { +Cloudron.prototype.checkAddons = function (domain, owner) { var lastError; // try many times because the scheduler takes sometime to run for (var i = 0; i < 100; i++) { - var res = request.post('https://' + this.appFqdn(location) + '/check_addons').query({ username: owner.username, password: owner.password }).end(); + var res = request.post('https://' + domain + '/check_addons').query({ username: owner.username, password: owner.password }).end(); try { assert.strictEqual(res.statusCode, 200); diff --git a/test/alt-domain-test.js b/test/alt-domain-test.js index 4e138a3..47b9959 100644 --- a/test/alt-domain-test.js +++ b/test/alt-domain-test.js @@ -64,11 +64,11 @@ describe('Custom domain test', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqdn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('can setup cname for altlocation', function (done) { diff --git a/test/app-flow-test.js b/test/app-flow-test.js index e03c75b..3b148f1 100644 --- a/test/app-flow-test.js +++ b/test/app-flow-test.js @@ -60,11 +60,11 @@ describe('Application flow test', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqdn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('displays app graphs', function () { diff --git a/test/cloudron-backup-test.js b/test/cloudron-backup-test.js index cb4b78d..391ccb3 100644 --- a/test/cloudron-backup-test.js +++ b/test/cloudron-backup-test.js @@ -62,11 +62,11 @@ describe('Cloudron backup testing', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqdn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('can backup the box', function () { diff --git a/test/cloudron-update-ams3-test.js b/test/cloudron-update-ams3-test.js index 6a34672..e30383e 100644 --- a/test/cloudron-update-ams3-test.js +++ b/test/cloudron-update-ams3-test.js @@ -77,11 +77,11 @@ describe('Cloudron update testing', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqdn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('can update the box', function () { diff --git a/test/cloudron-update-sfo1-test.js b/test/cloudron-update-sfo1-test.js index 1d27f6d..620fd46 100644 --- a/test/cloudron-update-sfo1-test.js +++ b/test/cloudron-update-sfo1-test.js @@ -77,11 +77,11 @@ describe('Cloudron update testing', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('can update the box', function () { diff --git a/test/custom-domain-test.js b/test/custom-domain-test.js index dce8e95..ee7db29 100644 --- a/test/custom-domain-test.js +++ b/test/custom-domain-test.js @@ -111,11 +111,11 @@ describe('Custom domain test', function () { }); it('can populate the addons', function () { - cloudron.populateAddons(location); + cloudron.populateAddons(cloudron.appFqdn(location)); }); it('can check the addons', function () { - cloudron.checkAddons(location, owner); + cloudron.checkAddons(cloudron.appFqdn(location), owner); }); it('can backup the box', function () {