Updating tests to use the new responseBody signature

This commit is contained in:
abhijitkane
2018-11-30 11:30:26 +05:30
parent 197f51adfc
commit 146cc21c20
2 changed files with 9 additions and 5 deletions

View File

@@ -405,6 +405,10 @@ module.exports = {
* @returns {string} string
*/
insertSpacesInName: function (string) {
if (!string) {
return null;
}
// convert createUser to create User
string = string.replace(/([a-z])([A-Z])/g, '$1 $2');

View File

@@ -853,7 +853,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
it('with undefined ContentObj', function() {
var contentObj,
pmResponseBody;
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
expect(pmResponseBody).to.equal('');
});
it('with Content-Type application/json', function() {
@@ -879,7 +879,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
},
pmResponseBody;
Utils.options.schemaFaker = true;
pmResponseBody = JSON.parse(Utils.convertToPmResponseBody(contentObj));
pmResponseBody = JSON.parse(Utils.convertToPmResponseBody(contentObj).responseBody);
expect(pmResponseBody.id).to.equal('<long>');
expect(pmResponseBody.name).to.equal('<string>');
});
@@ -893,7 +893,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
},
pmResponseBody;
Utils.options.schemaFaker = true;
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
expect(typeof pmResponseBody).to.equal('string');
});
it('with Content-Type application/xml', function() {
@@ -909,7 +909,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
},
pmResponseBody;
Utils.options.schemaFaker = true;
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
expect(typeof pmResponseBody).to.equal('string');
});
it('with Content-Type application/javascript', function() {
@@ -919,7 +919,7 @@ describe('UTILITY FUNCTION TESTS ', function () {
},
pmResponseBody;
Utils.options.schemaFaker = true;
pmResponseBody = Utils.convertToPmResponseBody(contentObj);
pmResponseBody = Utils.convertToPmResponseBody(contentObj).responseBody;
expect(typeof pmResponseBody).to.equal('string');
});
// things remaining application/xml, application/javascript