message: API: Add DownloadController clean up tests
diff: @@ -158,4 +158,19 @@ describe('DownloadFile', () => {
  res.status.should.be.equal(500);
  });
  });
  +
  + describe(`DELETE ${BASE_URL}/cleanup/cache`, () => {
  + it('should succeed with admin as user', async () => {
  + await requestCleanup();
  + });
  +
  + it('should fail with non-admin as user', async () => {
  + const student = await FixtureUtils.getRandomStudent();
  + const res = await chai.request(app)
  + .del(BASE_URL + '/cleanup/cache')
  + .set('Authorization', `JWT ${JwtUtils.generateToken(student)}`)
  + .catch(err => err.response);
  + res.status.should.be.equal(403);
  + });
  + });
  });
  