From 4a87988bf284858a32c52a568f75ecc6306bbd23 Mon Sep 17 00:00:00 2001 From: Girish Ramakrishnan Date: Sat, 30 Apr 2016 09:48:52 -0700 Subject: [PATCH] delete cname record --- test/alt-domain-test.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/test/alt-domain-test.js b/test/alt-domain-test.js index dde92fe..91501fb 100644 --- a/test/alt-domain-test.js +++ b/test/alt-domain-test.js @@ -118,6 +118,33 @@ describe('Alt domain test', function () { cloudron.uninstallApp(appId); }); + it('can delete cname for altlocation', function (done) { + route53.listHostedZonesByName({ DNSName: CUSTOM_DOMAIN, MaxItems: '1'}, function (error, result) { + if (error) return done(error); + + var params = { + ChangeBatch: { + Changes: [{ + Action: 'DELETE', + ResourceRecordSet: { + Type: 'CNAME', + Name: ALT_LOCATION + '.' + CUSTOM_DOMAIN + '.', + ResourceRecords: [ { Value: cloudron.appFqdn(location) } ], + TTL: 1 + } + }] + }, + HostedZoneId: result.HostedZones[0].Id + }; + + route53.changeResourceRecordSets(params, function(error) { + if (error) return done(error); + + done(); + }); + }); + }); + it('can delete the cloudron', function () { appStore.deleteCloudron(box); });