Allow users to be verified with both emails if cloudron mail is enabled

This commit is contained in:
Johannes Zellner
2016-09-27 15:08:58 +02:00
parent 5cff9df632
commit 35a964bd00
2 changed files with 28 additions and 3 deletions

View File

@@ -576,6 +576,25 @@ describe('User', function () {
done();
});
});
it('succeeds for both emails with cloudron mail', function (done) {
// user settingsdb instead of settings, to not trigger further events
settingsdb.set(settings.MAIL_CONFIG_KEY, JSON.stringify({ enabled: true }), function (error) {
expect(error).not.to.be.ok();
user.verifyWithEmail(EMAIL, PASSWORD, function (error, result) {
expect(error).to.not.be.ok();
expect(result).to.be.ok();
user.verifyWithEmail(USERNAME + '@' + config.fqdn(), PASSWORD, function (error, result) {
expect(error).to.not.be.ok();
expect(result).to.be.ok();
settingsdb.set(settings.MAIL_CONFIG_KEY, JSON.stringify({ enabled: false }), done);
});
});
});
});
});
describe('retrieving', function () {