set isCustomDomain to true by default

CaaS is an exception and not the norm
This commit is contained in:
Girish Ramakrishnan
2017-02-06 23:27:04 -08:00
parent 8f388c86a6
commit 02bcff2223
6 changed files with 37 additions and 34 deletions
+2 -2
View File
@@ -206,7 +206,7 @@ describe('Apps', function () {
expect(error).to.be(null);
expect(app).to.be.ok();
expect(app.iconUrl).to.be(null);
expect(app.fqdn).to.eql(APP_0.location + '-' + config.fqdn());
expect(app.fqdn).to.eql(APP_0.location + '.' + config.fqdn());
expect(app.memoryLimit).to.eql(0);
done();
});
@@ -218,7 +218,7 @@ describe('Apps', function () {
expect(apps).to.be.an(Array);
expect(apps[0].id).to.be(APP_0.id);
expect(apps[0].iconUrl).to.be(null);
expect(apps[0].fqdn).to.eql(APP_0.location + '-' + config.fqdn());
expect(apps[0].fqdn).to.eql(APP_0.location + '.' + config.fqdn());
done();
});
});
+19 -16
View File
@@ -1,4 +1,3 @@
/* jslint node:true */
/* global it:false */
/* global describe:false */
/* global before:false */
@@ -64,24 +63,28 @@ var APP = {
memoryLimit: 0
};
var awsHostedZones = {
HostedZones: [{
Id: '/hostedzone/ZONEID',
Name: 'localhost.',
CallerReference: '305AFD59-9D73-4502-B020-F4E6F889CB30',
ResourceRecordSetCount: 2,
ChangeInfo: {
Id: '/change/CKRTFJA0ANHXB',
Status: 'INSYNC'
}
}],
IsTruncated: false,
MaxItems: '100'
};
var awsHostedZones;
describe('apptask', function () {
before(function (done) {
config.set('version', '0.5.0');
config.set('fqdn', 'foobar.com');
awsHostedZones = {
HostedZones: [{
Id: '/hostedzone/ZONEID',
Name: config.fqdn() + '.',
CallerReference: '305AFD59-9D73-4502-B020-F4E6F889CB30',
ResourceRecordSetCount: 2,
ChangeInfo: {
Id: '/change/CKRTFJA0ANHXB',
Status: 'INSYNC'
}
}],
IsTruncated: false,
MaxItems: '100'
};
async.series([
database.initialize,
appdb.add.bind(null, APP.id, APP.appStoreId, APP.manifest, APP.location, APP.portBindings, APP),
@@ -209,7 +212,7 @@ describe('apptask', function () {
.get('/2013-04-01/hostedzone')
.times(2)
.reply(200, js2xml('ListHostedZonesResponse', awsHostedZones, { arrayMap: { HostedZones: 'HostedZone'} }))
.get('/2013-04-01/hostedzone/ZONEID/rrset?maxitems=1&name=applocation.localhost.&type=A')
.get('/2013-04-01/hostedzone/ZONEID/rrset?maxitems=1&name=applocation.' + config.fqdn() + '.&type=A')
.reply(200, js2xml('ListResourceRecordSetsResponse', { ResourceRecordSets: [ ] }, { 'Content-Type': 'application/xml' }))
.post('/2013-04-01/hostedzone/ZONEID/rrset/')
.reply(200, js2xml('ChangeResourceRecordSetsResponse', { ChangeInfo: { Id: 'RRID', Status: 'INSYNC' } }));
+3 -3
View File
@@ -37,10 +37,10 @@ describe('config', function () {
});
it('did set default values', function () {
expect(config.isCustomDomain()).to.equal(false);
expect(config.isCustomDomain()).to.equal(true);
expect(config.fqdn()).to.equal('localhost');
expect(config.adminOrigin()).to.equal('https://' + constants.ADMIN_LOCATION + '-localhost');
expect(config.appFqdn('app')).to.equal('app-localhost');
expect(config.adminOrigin()).to.equal('https://' + constants.ADMIN_LOCATION + '.localhost');
expect(config.appFqdn('app')).to.equal('app.localhost');
expect(config.zoneName()).to.equal('localhost');
});