validate user id when adding mailbox

This commit is contained in:
Girish Ramakrishnan
2018-04-03 14:27:09 -07:00
parent f8a731f63a
commit 7fac92c519
2 changed files with 12 additions and 4 deletions
+2 -1
View File
@@ -674,7 +674,8 @@ describe('Mail API', function () {
});
it('add fails if user does not exist', function (done) {
superagent.post(SERVER_URL + '/api/v1/mail/' + DOMAIN_0.domain + '/mailboxes/' + 'someuserdoesnotexist')
superagent.post(SERVER_URL + '/api/v1/mail/' + DOMAIN_0.domain + '/mailboxes')
.send({ name: MAILBOX_NAME, userId: userId + 'oops' })
.query({ access_token: token })
.end(function (err, res) {
expect(res.statusCode).to.equal(404);