Make users-test work

This commit is contained in:
Girish Ramakrishnan
2020-02-14 13:01:51 -08:00
parent c8000fdf90
commit 028852740d
3 changed files with 29 additions and 15 deletions

View File

@@ -743,7 +743,8 @@ describe('User', function () {
var user1 = {
username: 'seconduser',
password: 'ASDFkljsf#$^%2354',
email: 'some@thi.ng'
email: 'some@thi.ng',
admin: false
};
it('make second user admin does not send mail to action performer', function (done) {
@@ -758,6 +759,7 @@ describe('User', function () {
users.update(user1, { admin: true }, AUDIT_SOURCE, function (error) {
expect(error).to.not.be.ok();
user1.admin = true;
// no emails should be sent out anymore, since the user performing the action does not get a notification anymore
checkMails(0, done);
});
@@ -768,6 +770,7 @@ describe('User', function () {
users.update(user1, { admin: false }, AUDIT_SOURCE, function (error) {
expect(error).to.eql(null);
user1.admin = false;
// no emails should be sent out anymore, since the user performing the action does not get a notification anymore
checkMails(0, done);
});
@@ -777,14 +780,16 @@ describe('User', function () {
users.update(user1, { admin: true }, { ip: '1.2.3.4', userId: 'someuserid' }, function (error) {
expect(error).to.not.be.ok();
user1.admin = true;
checkMails(1, done);
});
});
xit('succeeds to remove admin flag does send mail to other admins', function (done) {
it('succeeds to remove admin flag does send mail to other admins', function (done) {
users.update(user1, { admin: false }, { ip: '1.2.3.4', userId: 'someuserid' }, function (error) {
expect(error).to.eql(null);
user1.admin = false;
checkMails(1, done);
});
});
@@ -807,7 +812,8 @@ describe('User', function () {
var user1 = {
username: 'seconduser',
password: 'Adfasdkjf#$%43',
email: 'some@thi.ng'
email: 'some@thi.ng',
admin: false
};
var invitor = { username: USERNAME, email: EMAIL };