2016-03-01 16:03:37 -08:00
|
|
|
'use strict';
|
|
|
|
|
|
2018-09-01 13:58:06 -04:00
|
|
|
const request = require('request');
|
2016-03-01 07:35:28 -08:00
|
|
|
|
|
|
|
|
describe('features', () => {
|
2016-03-23 12:33:26 -07:00
|
|
|
it('requires the master key to get features', done => {
|
2018-09-01 13:58:06 -04:00
|
|
|
request.get(
|
|
|
|
|
{
|
|
|
|
|
url: 'http://localhost:8378/1/serverInfo',
|
|
|
|
|
json: true,
|
|
|
|
|
headers: {
|
|
|
|
|
'X-Parse-Application-Id': 'test',
|
|
|
|
|
'X-Parse-REST-API-Key': 'rest',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
(error, response, body) => {
|
|
|
|
|
expect(response.statusCode).toEqual(403);
|
|
|
|
|
expect(body.error).toEqual('unauthorized: master key is required');
|
|
|
|
|
done();
|
2016-03-01 16:03:37 -08:00
|
|
|
}
|
2018-09-01 13:58:06 -04:00
|
|
|
);
|
2016-03-01 16:03:37 -08:00
|
|
|
});
|
2016-03-01 07:35:28 -08:00
|
|
|
});
|