var expect=require('chai').expect;
var http=require("http");
var request = require('request');
var env = require('./environment');
describe("Testing Callflow Functionality", function(done) {
//this.timeout(15000);
it("Testing the minutes field ",function(done){
var formData = [{
"variables":[{"name": "OpMode",
"value":"3",
"section": "Treatment",
"type": "queue"}]
}]
var data=(JSON.stringify(formData));
console.log(data);
console.log(JSON.stringify(formData));
var options={
url:env.hostname+'variables/menus/Call%20Flow?siteName=VHT%20TITAN&queueId=VHT_Test&segmentId=6&segmentName=58897&allQueues=false&allSegments=false',
**raw:data**,
headers:{
//'lastAccess':1516781803697,
'Token':'14275bb3c2fbc60d0dac05113dac1d6bcf3ccde00cf2699c43efedd820c2660a',
//'ttl':2592000000,
'Content-Type': 'application/json'
}
}
request.post(options,function(err,res,body) {
//console.log(JSON.stringify(options.raw));
console.log(options);
//body=JSON.parse(body);
expect(res.statusCode).to.equal(204);
done();
});
});
});
Note: When using 'form' instead of 'raw', a 500 internal server error is thrown. The same object works fine on Postman, returning status code 204 when testing this case there.