forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfeatures.spec.js
More file actions
39 lines (36 loc) · 1.07 KB
/
Copy pathfeatures.spec.js
File metadata and controls
39 lines (36 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
'use strict';
const request = require('../lib/request');
describe('features', () => {
it('should return the serverInfo', async () => {
const response = await request({
url: 'http://localhost:8378/1/serverInfo',
json: true,
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
'X-Parse-Master-Key': 'test',
},
});
const data = response.data;
expect(data).toBeDefined();
expect(data.features).toBeDefined();
expect(data.parseServerVersion).toBeDefined();
});
it('requires the master key to get features', async done => {
try {
await request({
url: 'http://localhost:8378/1/serverInfo',
json: true,
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-REST-API-Key': 'rest',
},
});
done.fail('The serverInfo request should be rejected without the master key');
} catch (error) {
expect(error.status).toEqual(403);
expect(error.data.error).toEqual('Permission denied');
done();
}
});
});