Fix various error codes

401 - bad password/wrong password
403 - authenticated but not authorized
409 - conflict
This commit is contained in:
Girish Ramakrishnan
2018-06-15 20:51:26 -07:00
parent 24b0a96f07
commit e8d9597345
9 changed files with 19 additions and 19 deletions
+1 -1
View File
@@ -234,7 +234,7 @@ describe('Domains API', function () {
.query({ access_token: token })
.send({ password: PASSWORD + PASSWORD })
.end(function (error, result) {
expect(result.statusCode).to.equal(403);
expect(result.statusCode).to.equal(401);
done();
});
+1 -1
View File
@@ -285,7 +285,7 @@ describe('Groups API', function () {
.query({ access_token: token })
.send({ groupIds: [ group0Object.id, group1Object.id ]})
.end(function (error, result) {
expect(result.statusCode).to.equal(403); // not allowed
expect(result.statusCode).to.equal(409); // not allowed
done();
});
});
+1 -1
View File
@@ -163,7 +163,7 @@ describe('Mail API', function () {
.send({ password: PASSWORD+PASSWORD })
.query({ access_token: token })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(401);
done();
});
});
+1 -1
View File
@@ -255,7 +255,7 @@ describe('Profile API', function () {
.query({ access_token: token_0 })
.send({ password: 'some wrong password', newPassword: 'MOre#$%34' })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(401);
done();
});
});
+5 -5
View File
@@ -358,7 +358,7 @@ describe('Users API', function () {
.query({ access_token: token })
.send({ groupIds: [ groupObject.id ] })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(409);
done();
});
});
@@ -525,7 +525,7 @@ describe('Users API', function () {
.query({ access_token: token })
.send({ password: PASSWORD })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(409);
done();
});
});
@@ -544,7 +544,7 @@ describe('Users API', function () {
.query({ access_token: token })
.send({ password: '' })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(401);
done();
});
});
@@ -554,7 +554,7 @@ describe('Users API', function () {
.query({ access_token: token })
.send({ password: PASSWORD + PASSWORD })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(401);
done();
});
});
@@ -574,7 +574,7 @@ describe('Users API', function () {
.query({ access_token: token })
.send({ password: PASSWORD })
.end(function (err, res) {
expect(res.statusCode).to.equal(403);
expect(res.statusCode).to.equal(409);
done();
});
});