Adjust tests to fail with invite email if cloudron mail is enabled

This commit is contained in:
Johannes Zellner
2016-09-27 17:35:44 +02:00
parent a6547676a1
commit c9d5af8424
2 changed files with 19 additions and 14 deletions
+3 -7
View File
@@ -200,21 +200,17 @@ describe('Ldap', function () {
});
});
it('succeeds with both emails and without accessRestriction when email is enabled', function (done) {
it('succeeds without accessRestriction when email is enabled', 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();
var client = ldap.createClient({ url: 'ldap://127.0.0.1:' + config.get('ldapPort') });
client.bind('cn=' + USER_0.email.toLowerCase() + ',ou=users,dc=cloudron', USER_0.password, function (error) {
client.bind('cn=' + USER_0.username.toLowerCase() + '@' + config.fqdn() + ',ou=users,dc=cloudron', USER_0.password, function (error) {
expect(error).to.be(null);
client.bind('cn=' + USER_0.username.toLowerCase() + '@' + config.fqdn() + ',ou=users,dc=cloudron', USER_0.password, function (error) {
expect(error).to.be(null);
settingsdb.set(settings.MAIL_CONFIG_KEY, JSON.stringify({ enabled: false }), done);
});
settingsdb.set(settings.MAIL_CONFIG_KEY, JSON.stringify({ enabled: false }), done);
});
});
});