fix: volatileClasses are masterKey only (#3916)
* volatileClass should respect the schema if defined * masterKey only for the volatileClasses * add some test …
This commit is contained in:
committed by
Florent Vilmart
parent
c4fbc1f358
commit
7d70af60ba
@@ -420,6 +420,35 @@ describe('rest create', () => {
|
||||
done();
|
||||
})
|
||||
});
|
||||
|
||||
it("can create object in volatileClasses if masterKey", (done) =>{
|
||||
rest.create(config, auth.master(config), '_PushStatus', {})
|
||||
.then((r) => {
|
||||
expect(r.response.objectId.length).toBe(10);
|
||||
})
|
||||
.then(() => {
|
||||
rest.create(config, auth.master(config), '_JobStatus', {})
|
||||
.then((r) => {
|
||||
expect(r.response.objectId.length).toBe(10);
|
||||
done();
|
||||
})
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
it("cannot create object in volatileClasses if not masterKey", (done) =>{
|
||||
Promise.resolve()
|
||||
.then(() => {
|
||||
rest.create(config, auth.nobody(config), '_PushStatus', {})
|
||||
})
|
||||
.then((r) => {
|
||||
console.log(r);
|
||||
})
|
||||
.catch((error) => {
|
||||
expect(error.code).toEqual(119);
|
||||
done();
|
||||
})
|
||||
})
|
||||
});
|
||||
|
||||
describe('rest update', () => {
|
||||
|
||||
Reference in New Issue
Block a user