Updating with two GeoPoints fails correctly. (#4162)

This commit is contained in:
Anthony Mosca
2017-09-19 20:42:40 +09:30
committed by Florent Vilmart
parent 406a21e967
commit cf630ba462
3 changed files with 29 additions and 6 deletions

View File

@@ -68,8 +68,7 @@ describe('Parse.GeoPoint testing', () => {
})
});
it('geo point exception two fields', (done) => {
it('creating geo point exception two fields', (done) => {
var point = new Parse.GeoPoint(20, 20);
var obj = new TestObject();
obj.set('locationOne', point);
@@ -82,6 +81,24 @@ describe('Parse.GeoPoint testing', () => {
});
});
// TODO: This should also have support in postgres, or higher level database agnostic support.
it_exclude_dbs(['postgres'])('updating geo point exception two fields', (done) => {
var point = new Parse.GeoPoint(20, 20);
var obj = new TestObject();
obj.set('locationOne', point);
obj.save(null, {
success: (obj) => {
obj.set('locationTwo', point);
obj.save().then(() => {
fail('expected error');
}, (err) => {
equal(err.code, Parse.Error.INCORRECT_TYPE);
done();
})
}
});
});
it('geo line', (done) => {
var line = [];
for (var i = 0; i < 10; ++i) {