This commit is contained in:
Girish Ramakrishnan
2018-06-11 10:01:50 -07:00
parent eeaaa95ca3
commit 90d7dc893c

View File

@@ -121,27 +121,9 @@ describe('Mail', function () {
});
});
it('cannot enable mail without a subscription', function (done) {
var scope = 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: 'free', plan: { id: 'free' }}});
mail.setMailEnabled(DOMAIN_0.domain, true, function (error) {
expect(error).to.be.a(MailError);
expect(error.reason).to.equal(MailError.BILLING_REQUIRED);
expect(scope.isDone()).to.be.ok();
done();
});
});
it('can enable mail', function (done) {
var scope = 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', plan: { id: 'basic' }}});
mail.setMailEnabled(DOMAIN_0.domain, true, function (error) {
expect(error).to.be(null);
expect(scope.isDone()).to.be.ok();
mail.getDomain(DOMAIN_0.domain, function (error, mailConfig) {
expect(error).to.be(null);