Skip to content

WIP: Troubleshooting #2275 #2300

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions spec/PushController.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
var PushController = require('../src/Controllers/PushController').PushController;
var pushStatusHandler = require('../src/pushStatusHandler');
var Config = require('../src/Config');
var rp = require('request-promise');

const successfulTransmissions = function(body, installations) {

Expand Down Expand Up @@ -313,6 +314,22 @@ describe('PushController', () => {
return query.find();
}).then((results) => {
expect(results.length).toBe(0);
return rp.get(Parse.serverURL+'/schemas', {
headers: {
'X-Parse-Application-Id': 'test',
'X-Parse-Master-Key': 'test'
},
json: true
})
}).then((res) => {
expect(res.results.length).not.toBe(0);
res.results.forEach((result) => {
expect(result.className).not.toEqual('_PushStatus');
});
done();
}).catch((err) => {
console.error(err);
fail('should not fail');
done();
});

Expand Down
27 changes: 27 additions & 0 deletions spec/Schema.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -798,4 +798,31 @@ describe('SchemaController', () => {
});
done();
});

it_exclude_dbs(['postgres'])('should not write _PushStaths to the schema on getOneSchema', (done) => {
var schema;
var config = new Config(Parse.applicationId);
var called;
config.database.loadSchema().then((aSchema) => {
schema = aSchema;
return schema.getOneSchema('_PushStatus');
}).catch(err => {
called = true;
return schema.getOneSchema('_PushStatus', true);
}).then((res) => {
expect(called).toBe(true);
expect(res).not.toBeUndefined();
return config.database.adapter._rawFind("_SCHEMA")
}).then((results) => {
expect(results.length).toBe(1);
results.forEach((result) => {
expect(result._id).not.toEqual('_PushStatus');
});
done();
}).catch((err) => {
console.error(err);
fail(err);
done();
});
});
});