move logic to model code

This commit is contained in:
Girish Ramakrishnan
2016-06-02 22:25:48 -07:00
parent 13a1213b0d
commit 097d23c412
4 changed files with 44 additions and 17 deletions

View File

@@ -467,6 +467,16 @@ describe('User API', function () {
});
});
it('remove random user fails', function (done) {
superagent.del(SERVER_URL + '/api/v1/users/randomid')
.query({ access_token: token })
.send({ password: PASSWORD })
.end(function (err, res) {
expect(res.statusCode).to.equal(404);
done();
});
});
it('user removes himself is not allowed', function (done) {
superagent.del(SERVER_URL + '/api/v1/users/' + user_0.id)
.query({ access_token: token })