Fix #179: Can't send empty string with utf8 serializer

This commit is contained in:
Sefa Ilkimen
2019-01-17 17:03:12 +01:00
parent dadbf97d0c
commit 6033ea4b76
2 changed files with 10 additions and 3 deletions
+9
View File
@@ -484,6 +484,15 @@ const tests = [
result.data.status.should.be.equal(200);
JSON.parse(result.data.data).gzipped.should.be.equal(true);
}
},{
description: 'should send empty string correctly',
expected: 'resolved: {"status": 200, "data": "{\\"json\\":\\"test\\": \\"testString\\"}\" ...',
before: helpers.setUtf8StringSerializer,
func: function(resolve, reject) { cordova.plugin.http.post('http://httpbin.org/anything', '', {}, resolve, reject); },
validationFunc: function(driver, result) {
result.type.should.be.equal('resolved');
JSON.parse(result.data.data).data.should.be.equal('');
}
}
];