check email subject correctly
This commit is contained in:
parent
a0c88cbd43
commit
b0c45d00c3
|
@ -462,6 +462,14 @@ Cloudron.prototype.setEmailEnabled = function (enabled) {
|
||||||
sleep(60); // generously wait for the mail server to restart. it takes 10 seconds to stop it... and then there is DNS propagation
|
sleep(60); // generously wait for the mail server to restart. it takes 10 seconds to stop it... and then there is DNS propagation
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Cloudron.prototype.setCloudronName = function (name) {
|
||||||
|
var res = request
|
||||||
|
.post(this._origin + '/api/v1/settings/cloudron_name').query({ access_token: this._credentials.accessToken })
|
||||||
|
.send({ name: name})
|
||||||
|
.end();
|
||||||
|
common.verifyResponse2xx(res, 'Could not enable email');
|
||||||
|
};
|
||||||
|
|
||||||
Cloudron.prototype.checkTimeZone = function (tz) {
|
Cloudron.prototype.checkTimeZone = function (tz) {
|
||||||
var res = request.get(this._origin + '/api/v1/settings/time_zone').query({ access_token: this._credentials.accessToken }).end();
|
var res = request.get(this._origin + '/api/v1/settings/time_zone').query({ access_token: this._credentials.accessToken }).end();
|
||||||
common.verifyResponse2xx(res, 'Could not query timezone');
|
common.verifyResponse2xx(res, 'Could not query timezone');
|
||||||
|
|
|
@ -70,12 +70,16 @@ describe('Cloudron user creation testing', function () {
|
||||||
newUser = cloudron.addUser('newuser', 'test+foo@cloudron.io');
|
newUser = cloudron.addUser('newuser', 'test+foo@cloudron.io');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can set cloudron name', function () {
|
||||||
|
cloudron.setCloudronName('Acme Inc');
|
||||||
|
});
|
||||||
|
|
||||||
it('did send invite mail to user', function (done) {
|
it('did send invite mail to user', function (done) {
|
||||||
var url = 'https://' + cloudron.adminFqdn() + '/api/v1/session/account/setup.html?reset_token=' + newUser.resetToken;
|
var url = 'https://' + cloudron.adminFqdn() + '/api/v1/session/account/setup.html?reset_token=' + newUser.resetToken;
|
||||||
var escapedUrl = url.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
var escapedUrl = url.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&');
|
||||||
|
|
||||||
imap.probe({
|
imap.probe({
|
||||||
subject: new RegExp('Welcome to Cloudron ' + box.domain + '$'),
|
subject: new RegExp('Welcome to Acme Inc$'),
|
||||||
body: new RegExp(escapedUrl)
|
body: new RegExp(escapedUrl)
|
||||||
}, done);
|
}, done);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue