diff --git a/src/routes/test/backups-test.js b/src/routes/test/backups-test.js index 6a26ad1b8..0c92fd707 100644 --- a/src/routes/test/backups-test.js +++ b/src/routes/test/backups-test.js @@ -108,4 +108,35 @@ describe('Backups API', function () { }); }); }); + + describe('check', function () { + it('fails due to mising token', function (done) { + superagent.get(SERVER_URL + '/api/v1/backups/check') + .end(function (error, result) { + expect(result.statusCode).to.equal(401); + done(); + }); + }); + + it('fails due to wrong token', function (done) { + superagent.get(SERVER_URL + '/api/v1/backups/check') + .query({ access_token: token.toUpperCase() }) + .end(function (error, result) { + expect(result.statusCode).to.equal(401); + done(); + }); + }); + + it('succeeds', function (done) { + superagent.get(SERVER_URL + '/api/v1/backups/check') + .query({ access_token: token }) + .end(function (error, result) { + expect(result.statusCode).to.equal(200); + expect(result.body.ok).to.equal(false); + expect(result.body.message).to.not.be.empty(); + + done(); + }); + }); + }); });