Postgres: $all, $and CLP and more (#2551)

* Adds passing tests

* Better containsAll implementation

* Full Geopoint support, fix inverted lat/lng

* Adds support for $and operator / PointerPermissions specs

* Fix issue updating CLPs on schema

* Extends query support

* Adds RestCreate to the specs

* Adds User specs

* Adds error handlers for failing tests

* nits

* Proper JSON update of AuthData

* fix for #1259 with PG

* Fix for Installations _PushStatus test

* Adds support for GlobalConfig

* Enables relations tests

* Exclude spec as legacy

* Makes corner case for 1 in GlobalConfig
This commit is contained in:
Florent Vilmart
2016-08-20 16:07:48 -04:00
committed by GitHub
parent e1de9f3a12
commit 9ab488b6a0
17 changed files with 276 additions and 138 deletions

View File

@@ -7,15 +7,24 @@ let Config = require('../src/Config');
describe('a GlobalConfig', () => {
beforeEach(done => {
let config = new Config('test');
let query = on_db('mongo', () => {
// Legacy is with an int...
return { objectId: 1 };
}, () => {
return { objectId: "1" }
})
config.database.adapter.upsertOneObject(
'_GlobalConfig',
{ fields: {} },
{ objectId: 1 },
{ fields: { objectId: { type: 'Number' }, params: {type: 'Object'}} },
query,
{ params: { companies: ['US', 'DK'] } }
).then(done, done);
).then(done, (err) => {
jfail(err);
done();
});
});
it_exclude_dbs(['postgres'])('can be retrieved', (done) => {
it('can be retrieved', (done) => {
request.get({
url : 'http://localhost:8378/1/config',
json : true,
@@ -32,7 +41,7 @@ describe('a GlobalConfig', () => {
});
});
it_exclude_dbs(['postgres'])('can be updated when a master key exists', (done) => {
it('can be updated when a master key exists', (done) => {
request.put({
url : 'http://localhost:8378/1/config',
json : true,
@@ -48,7 +57,7 @@ describe('a GlobalConfig', () => {
});
});
it_exclude_dbs(['postgres'])('properly handles delete op', (done) => {
it('properly handles delete op', (done) => {
request.put({
url : 'http://localhost:8378/1/config',
json : true,
@@ -79,7 +88,7 @@ describe('a GlobalConfig', () => {
});
});
it_exclude_dbs(['postgres'])('fail to update if master key is missing', (done) => {
it('fail to update if master key is missing', (done) => {
request.put({
url : 'http://localhost:8378/1/config',
json : true,
@@ -95,12 +104,12 @@ describe('a GlobalConfig', () => {
});
});
it_exclude_dbs(['postgres'])('failed getting config when it is missing', (done) => {
it('failed getting config when it is missing', (done) => {
let config = new Config('test');
config.database.adapter.deleteObjectsByQuery(
'_GlobalConfig',
{ fields: { params: { __type: 'String' } } },
{ objectId: 1 }
{ objectId: "1" }
).then(() => {
request.get({
url : 'http://localhost:8378/1/config',