Allow setup to be run again as long as not-activated

this is useful if the activation fails somewhere mid-way and we don't
need to re-setup the cloudron all over
This commit is contained in:
Girish Ramakrishnan
2018-12-07 14:35:04 -08:00
parent 331c8ae247
commit 8d944f9a4a
6 changed files with 95 additions and 45 deletions

View File

@@ -137,12 +137,12 @@ describe('REST API', function () {
});
});
it('dns setup twice fails', function (done) {
it('dns setup twice succeeds', function (done) {
superagent.post(SERVER_URL + '/api/v1/cloudron/setup')
.send({ dnsConfig: { provider: 'noop', domain: DOMAIN, DOMAIN, config: {} } })
.end(function (error, result) {
expect(result).to.be.ok();
expect(result.statusCode).to.eql(409);
expect(result.statusCode).to.eql(200);
done();
});
@@ -247,6 +247,17 @@ describe('REST API', function () {
});
});
it('dns setup after activation fails', function (done) {
superagent.post(SERVER_URL + '/api/v1/cloudron/setup')
.send({ dnsConfig: { provider: 'noop', domain: DOMAIN, DOMAIN, config: {} } })
.end(function (error, result) {
expect(result).to.be.ok();
expect(result.statusCode).to.eql(409);
done();
});
});
it('does not crash with invalid JSON', function (done) {
superagent.post(SERVER_URL + '/api/v1/users')
.query({ access_token: token })