Skip to content

Commit 96b71c0

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

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

spec/Schema.spec.js

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

0 commit comments

Comments
 (0)