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:
Worathiti Manosroi
2017-06-13 16:36:40 +02:00
committed by Florent Vilmart
parent c4fbc1f358
commit 7d70af60ba
4 changed files with 40 additions and 4 deletions

View File

@@ -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', () => {