Add allowClientClassCreation option
This commit is contained in:
@@ -95,6 +95,20 @@ describe('rest query', () => {
|
||||
}).catch((error) => { console.log(error); });
|
||||
});
|
||||
|
||||
it('query non-existent class when disabled client class creation', (done) => {
|
||||
var customConfig = Object.assign({}, config, {allowClientClassCreation: false});
|
||||
rest.find(customConfig, auth.nobody(customConfig), 'ClientClassCreation', {})
|
||||
.then(() => {
|
||||
fail('Should throw an error');
|
||||
done();
|
||||
}, (err) => {
|
||||
expect(err.code).toEqual(Parse.Error.OPERATION_FORBIDDEN);
|
||||
expect(err.message).toEqual('This user is not allowed to access ' +
|
||||
'non-existent class: ClientClassCreation');
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('query with wrongly encoded parameter', (done) => {
|
||||
rest.create(config, nobody, 'TestParameterEncode', {foo: 'bar'}
|
||||
).then(() => {
|
||||
|
||||
Reference in New Issue
Block a user