Skip to content

Commit 65924a2

Browse files
committed
Adds db based test to check if _PushStatus gets written
1 parent d4ef760 commit 65924a2

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

spec/Schema.spec.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -798,4 +798,32 @@ describe('SchemaController', () => {
798798
});
799799
done();
800800
});
801+
802+
803+
it_exclude_dbs(['postgres'])('should not write _PushStaths to the schema on getOneSchema', (done) => {
804+
var schema;
805+
var config = new Config(Parse.applicationId);
806+
var called;
807+
config.database.loadSchema().then((aSchema) => {
808+
schema = aSchema;
809+
return schema.getOneSchema('_PushStatus');
810+
}).catch(err => {
811+
called = true;
812+
return schema.getOneSchema('_PushStatus', true);
813+
}).then((res) => {
814+
expect(called).toBe(true);
815+
expect(res).not.toBeUndefined();
816+
return config.database.adapter._rawFind("_SCHEMA")
817+
}).then((results) => {
818+
expect(results.length).toBe(1);
819+
results.forEach((result) => {
820+
expect(result._id).not.toEqual('_PushStatus');
821+
});
822+
done();
823+
}).catch((err) => {
824+
console.error(err);
825+
fail(err);
826+
done();
827+
});
828+
});
801829
});

0 commit comments

Comments
 (0)