escape the email

This commit is contained in:
Girish Ramakrishnan 2016-06-24 12:38:26 -05:00
parent 1c08896f2d
commit 86152e3f99
2 changed files with 8 additions and 3 deletions

View File

@ -17,11 +17,16 @@ exports = module.exports = {
getOwner: getOwner,
getAdmin: getAdmin,
stripeSecret: stripeSecret,
stripUnreachable: stripUnreachable
stripUnreachable: stripUnreachable,
regexp: regexp
};
var gEcosystem = safe.require(path.join(__dirname, '../secrets/e2e-test/ecosystem-staging.json'));
function regexp(str) {
return new RegExp(str.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'));
}
function cloudronDomain(filename) {
return 't' + path.basename(filename.replace(/-/g,''), 'test.js') + '.selfhost.io';
}

View File

@ -81,8 +81,8 @@ describe('Cloudron backup testing', function () {
it('did send mail from cloudron user', function (done) {
imap.probe({
subject: new RegExp('^Hi from e2e test - ' + cloudron.fqdn() + '$'),
to: new RegExp('test+' + cloudron.fqdn() + '@cloudron.io'),
subject: common.regexp('^Hi from e2e test - ' + cloudron.fqdn() + '$'),
to: common.regexp('test+' + cloudron.fqdn() + '@cloudron.io'),
body: /This release depends on you/
}, done);
});