Postgres: Operations, Hooks, OAuth login, Files support (#2528)

* Adds files related tests through fs-adapter with PG

* Schema deletions implementations

* Adds Hooks spec

* Fix test

* Adds support for containsAll (numbers and strings)

* Better support for deleteFields and deleteClass

* Recursive JSON update for authData

* Adds node_modules to travis cache

* Disable temporarily to make tests pass

* Adds _perishable_token support for _User class

* ignore when a table creation fails at init (table exists)

* Adds support for AddUnique and Remove

* PG 9.4 compatible functions

* Re-enable tests

* nit

* Better handling of schema creation race
This commit is contained in:
Florent Vilmart
2016-08-18 18:05:26 -04:00
committed by GitHub
parent 3164b478ea
commit 9ecb9a3595
18 changed files with 350 additions and 130 deletions

View File

@@ -170,7 +170,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('responds with a list of schemas after creating objects', done => {
it('responds with a list of schemas after creating objects', done => {
var obj1 = hasAllPODobject();
obj1.save().then(savedObj1 => {
var obj2 = new Parse.Object('HasPointersAndRelations');
@@ -193,7 +193,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('responds with a single schema', done => {
it('responds with a single schema', done => {
var obj = hasAllPODobject();
obj.save().then(() => {
request.get({
@@ -207,7 +207,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('treats class names case sensitively', done => {
it('treats class names case sensitively', done => {
var obj = hasAllPODobject();
obj.save().then(() => {
request.get({
@@ -462,7 +462,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('refuses to put to existing fields, even if it would not be a change', done => {
it('refuses to put to existing fields, even if it would not be a change', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -484,7 +484,7 @@ describe('schemas', () => {
})
});
it_exclude_dbs(['postgres'])('refuses to delete non-existent fields', done => {
it('refuses to delete non-existent fields', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -506,7 +506,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('refuses to add a geopoint to a class that already has one', done => {
it('refuses to add a geopoint to a class that already has one', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -552,7 +552,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('allows you to delete and add a geopoint in the same request', done => {
it('allows you to delete and add a geopoint in the same request', done => {
var obj = new Parse.Object('NewClass');
obj.set('geo1', new Parse.GeoPoint({latitude: 0, longitude: 0}));
obj.save()
@@ -584,7 +584,7 @@ describe('schemas', () => {
})
});
it_exclude_dbs(['postgres'])('put with no modifications returns all fields', done => {
it('put with no modifications returns all fields', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -757,7 +757,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('will not delete any fields if the additions are invalid', done => {
it('will not delete any fields if the additions are invalid', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -798,7 +798,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('refuses to delete non-empty collection', done => {
it('refuses to delete non-empty collection', done => {
var obj = hasAllPODobject();
obj.save()
.then(() => {
@@ -829,7 +829,7 @@ describe('schemas', () => {
})
});
it_exclude_dbs(['postgres'])('does not fail when deleting nonexistant collections', done => {
it('does not fail when deleting nonexistant collections', done => {
request.del({
url: 'http://localhost:8378/1/schemas/Missing',
headers: masterKeyHeaders,
@@ -841,7 +841,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('deletes collections including join tables', done => {
it('deletes collections including join tables', done => {
var obj = new Parse.Object('MyClass');
obj.set('data', 'data');
obj.save()
@@ -892,7 +892,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('deletes schema when actual collection does not exist', done => {
it('deletes schema when actual collection does not exist', done => {
request.post({
url: 'http://localhost:8378/1/schemas/NewClassForDelete',
headers: masterKeyHeaders,
@@ -920,7 +920,7 @@ describe('schemas', () => {
});
});
it_exclude_dbs(['postgres'])('deletes schema when actual collection exists', done => {
it('deletes schema when actual collection exists', done => {
request.post({
url: 'http://localhost:8378/1/schemas/NewClassForDelete',
headers: masterKeyHeaders,
@@ -1582,7 +1582,7 @@ describe('schemas', () => {
})
})
it_exclude_dbs(['postgres'])('gives correct response when deleting a schema with CLPs (regression test #1919)', done => {
it('gives correct response when deleting a schema with CLPs (regression test #1919)', done => {
new Parse.Object('MyClass').save({ data: 'foo'})
.then(obj => obj.destroy())
.then(() => setPermissionsOnClass('MyClass', { find: {}, get: {} }, true))