diff --git a/lib/base/Page.js b/lib/base/Page.js index 4ab8ffd858..785e0976d8 100644 --- a/lib/base/Page.js +++ b/lib/base/Page.js @@ -156,7 +156,7 @@ Page.prototype.processResponse = function(response) { throw new RestException(response); } - return JSON.parse(response.body); + return response.body; }; /** diff --git a/spec/integration/rest/accounts/v1/credential/aws.spec.js b/spec/integration/rest/accounts/v1/credential/aws.spec.js index 63ce383091..f59d80ce60 100644 --- a/spec/integration/rest/accounts/v1/credential/aws.spec.js +++ b/spec/integration/rest/accounts/v1/credential/aws.spec.js @@ -31,7 +31,7 @@ describe('Aws', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -51,7 +51,7 @@ describe('Aws', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .aws.each(() => done()); @@ -59,7 +59,7 @@ describe('Aws', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -79,7 +79,7 @@ describe('Aws', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .aws.each({pageSize: 20}, () => done()); @@ -92,7 +92,7 @@ describe('Aws', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -112,7 +112,7 @@ describe('Aws', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .aws.each({callback: () => done()}, () => fail('wrong callback!')); @@ -120,7 +120,7 @@ describe('Aws', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .aws.list(); @@ -141,7 +141,7 @@ describe('Aws', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'first_page_url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0', @@ -152,7 +152,7 @@ describe('Aws', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -168,7 +168,7 @@ describe('Aws', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('Aws', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/AWS?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -204,7 +204,7 @@ describe('Aws', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {credentials: 'AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY'}; var promise = client.accounts.v1.credentials @@ -228,14 +228,14 @@ describe('Aws', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -252,7 +252,7 @@ describe('Aws', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -274,14 +274,14 @@ describe('Aws', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -297,7 +297,7 @@ describe('Aws', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -319,14 +319,14 @@ describe('Aws', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/AWS/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -342,7 +342,7 @@ describe('Aws', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .aws('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -364,7 +364,7 @@ describe('Aws', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/accounts/v1/credential/publicKey.spec.js b/spec/integration/rest/accounts/v1/credential/publicKey.spec.js index 43d1dd41f1..43a4e09ba3 100644 --- a/spec/integration/rest/accounts/v1/credential/publicKey.spec.js +++ b/spec/integration/rest/accounts/v1/credential/publicKey.spec.js @@ -31,7 +31,7 @@ describe('PublicKey', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -51,7 +51,7 @@ describe('PublicKey', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .publicKey.each(() => done()); @@ -59,7 +59,7 @@ describe('PublicKey', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -79,7 +79,7 @@ describe('PublicKey', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .publicKey.each({pageSize: 20}, () => done()); @@ -92,7 +92,7 @@ describe('PublicKey', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -112,7 +112,7 @@ describe('PublicKey', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.accounts.v1.credentials .publicKey.each({callback: () => done()}, () => fail('wrong callback!')); @@ -120,7 +120,7 @@ describe('PublicKey', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .publicKey.list(); @@ -141,7 +141,7 @@ describe('PublicKey', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'first_page_url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0', @@ -152,7 +152,7 @@ describe('PublicKey', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -168,7 +168,7 @@ describe('PublicKey', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('PublicKey', function() { 'previous_page_url': null, 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -204,7 +204,7 @@ describe('PublicKey', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {publicKey: 'publickey'}; var promise = client.accounts.v1.credentials @@ -228,14 +228,14 @@ describe('PublicKey', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -252,7 +252,7 @@ describe('PublicKey', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -274,14 +274,14 @@ describe('PublicKey', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -297,7 +297,7 @@ describe('PublicKey', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -319,14 +319,14 @@ describe('PublicKey', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-31T04:00:00Z', 'date_updated': '2015-07-31T04:00:00Z', 'friendly_name': 'friendly_name', 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://accounts.twilio.com/v1/Credentials/PublicKeys/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -342,7 +342,7 @@ describe('PublicKey', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.accounts.v1.credentials .publicKey('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -364,7 +364,7 @@ describe('PublicKey', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account.spec.js b/spec/integration/rest/api/v2010/account.spec.js index b67f581e40..e68ae65514 100644 --- a/spec/integration/rest/api/v2010/account.spec.js +++ b/spec/integration/rest/api/v2010/account.spec.js @@ -31,7 +31,7 @@ describe('Account', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts.create(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Account', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'auth_token': 'auth_token', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', @@ -83,7 +83,7 @@ describe('Account', function() { }, 'type': 'Full', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -98,7 +98,7 @@ describe('Account', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -119,7 +119,7 @@ describe('Account', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'auth_token': 'auth_token', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', @@ -151,7 +151,7 @@ describe('Account', function() { }, 'type': 'Full', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -166,7 +166,7 @@ describe('Account', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -210,14 +210,14 @@ describe('Account', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -261,7 +261,7 @@ describe('Account', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -273,7 +273,7 @@ describe('Account', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -317,14 +317,14 @@ describe('Account', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts.list(); promise.then(function() { @@ -344,7 +344,7 @@ describe('Account', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -354,7 +354,7 @@ describe('Account', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -369,7 +369,7 @@ describe('Account', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts.json?FriendlyName=friendly_name&Status=active&PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -413,7 +413,7 @@ describe('Account', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -428,7 +428,7 @@ describe('Account', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -449,7 +449,7 @@ describe('Account', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'auth_token': 'auth_token', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', @@ -481,7 +481,7 @@ describe('Account', function() { }, 'type': 'Full', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -496,7 +496,7 @@ describe('Account', function() { ); it('should generate valid update_with_numeric_status response', function(done) { - var body = JSON.stringify({ + var body = { 'auth_token': 'auth_token', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', @@ -528,7 +528,7 @@ describe('Account', function() { }, 'type': 'Full', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/address.spec.js b/spec/integration/rest/api/v2010/account/address.spec.js index 8954f5a840..1a2dbff5ba 100644 --- a/spec/integration/rest/api/v2010/account/address.spec.js +++ b/spec/integration/rest/api/v2010/account/address.spec.js @@ -31,7 +31,7 @@ describe('Address', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { customerName: 'customer_name', @@ -70,7 +70,7 @@ describe('Address', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'city': 'SF', 'customer_name': 'name', @@ -86,7 +86,7 @@ describe('Address', function() { 'validated': false, 'verified': false, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -110,7 +110,7 @@ describe('Address', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -133,7 +133,7 @@ describe('Address', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -149,7 +149,7 @@ describe('Address', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -172,7 +172,7 @@ describe('Address', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'city': 'SF', 'customer_name': 'name', @@ -188,7 +188,7 @@ describe('Address', function() { 'validated': false, 'verified': false, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -204,7 +204,7 @@ describe('Address', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -227,7 +227,7 @@ describe('Address', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'city': 'SF', 'customer_name': 'name', @@ -243,7 +243,7 @@ describe('Address', function() { 'validated': false, 'verified': false, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -259,7 +259,7 @@ describe('Address', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'addresses': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -290,7 +290,7 @@ describe('Address', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses.each(() => done()); @@ -298,7 +298,7 @@ describe('Address', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'addresses': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -329,7 +329,7 @@ describe('Address', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses.each({pageSize: 20}, () => done()); @@ -342,7 +342,7 @@ describe('Address', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'addresses': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -373,7 +373,7 @@ describe('Address', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses.each({callback: () => done()}, () => fail('wrong callback!')); @@ -381,7 +381,7 @@ describe('Address', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses.list(); @@ -403,7 +403,7 @@ describe('Address', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'addresses': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -434,7 +434,7 @@ describe('Address', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -450,7 +450,7 @@ describe('Address', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'addresses': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0', @@ -463,7 +463,7 @@ describe('Address', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/address/dependentPhoneNumber.spec.js b/spec/integration/rest/api/v2010/account/address/dependentPhoneNumber.spec.js index 889e488df4..3e9ab4c9fa 100644 --- a/spec/integration/rest/api/v2010/account/address/dependentPhoneNumber.spec.js +++ b/spec/integration/rest/api/v2010/account/address/dependentPhoneNumber.spec.js @@ -31,7 +31,7 @@ describe('DependentPhoneNumber', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'dependent_phone_numbers': [ { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('DependentPhoneNumber', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -81,7 +81,7 @@ describe('DependentPhoneNumber', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'dependent_phone_numbers': [ { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -122,7 +122,7 @@ describe('DependentPhoneNumber', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -136,7 +136,7 @@ describe('DependentPhoneNumber', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'dependent_phone_numbers': [ { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -177,7 +177,7 @@ describe('DependentPhoneNumber', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -186,7 +186,7 @@ describe('DependentPhoneNumber', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .addresses('ADXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -210,7 +210,7 @@ describe('DependentPhoneNumber', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'dependent_phone_numbers': [ { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('DependentPhoneNumber', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('DependentPhoneNumber', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'dependent_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json?Page=0&PageSize=50', 'next_page_uri': null, @@ -276,7 +276,7 @@ describe('DependentPhoneNumber', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Addresses/ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentPhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/application.spec.js b/spec/integration/rest/api/v2010/account/application.spec.js index 2fff066571..89e20d83b6 100644 --- a/spec/integration/rest/api/v2010/account/application.spec.js +++ b/spec/integration/rest/api/v2010/account/application.spec.js @@ -31,7 +31,7 @@ describe('Application', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications.create(); @@ -53,7 +53,7 @@ describe('Application', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Mon, 22 Aug 2011 20:59:45 +0000', @@ -74,7 +74,7 @@ describe('Application', function() { 'voice_fallback_url': 'http://www.example.com/voice-callback', 'voice_method': 'GET', 'voice_url': 'http://example.com' - }); + }; holodeck.mock(new Response(201, body)); @@ -90,7 +90,7 @@ describe('Application', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications('APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -113,7 +113,7 @@ describe('Application', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Application', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications('APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -152,7 +152,7 @@ describe('Application', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Mon, 22 Aug 2011 20:59:45 +0000', @@ -173,7 +173,7 @@ describe('Application', function() { 'voice_fallback_url': 'http://www.example.com/voice-callback', 'voice_method': 'GET', 'voice_url': 'http://example.com' - }); + }; holodeck.mock(new Response(200, body)); @@ -189,7 +189,7 @@ describe('Application', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'applications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -222,7 +222,7 @@ describe('Application', function() { 'page': 0, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications.each(() => done()); @@ -230,7 +230,7 @@ describe('Application', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'applications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -263,7 +263,7 @@ describe('Application', function() { 'page': 0, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications.each({pageSize: 20}, () => done()); @@ -276,7 +276,7 @@ describe('Application', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'applications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -309,7 +309,7 @@ describe('Application', function() { 'page': 0, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications.each({callback: () => done()}, () => fail('wrong callback!')); @@ -317,7 +317,7 @@ describe('Application', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications.list(); @@ -339,7 +339,7 @@ describe('Application', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'applications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -372,7 +372,7 @@ describe('Application', function() { 'page': 0, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -388,7 +388,7 @@ describe('Application', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'applications': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0', @@ -398,7 +398,7 @@ describe('Application', function() { 'next_page_uri': null, 'page': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Applications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -414,7 +414,7 @@ describe('Application', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .applications('APXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -437,7 +437,7 @@ describe('Application', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Mon, 22 Aug 2011 20:59:45 +0000', @@ -458,7 +458,7 @@ describe('Application', function() { 'voice_fallback_url': 'http://www.example.com/voice-callback', 'voice_method': 'GET', 'voice_url': 'http://example.com' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js b/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js index 2b477a96cb..5b0baaecbe 100644 --- a/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js +++ b/spec/integration/rest/api/v2010/account/authorizedConnectApp.spec.js @@ -31,7 +31,7 @@ describe('AuthorizedConnectApp', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .authorizedConnectApps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('AuthorizedConnectApp', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'connect_app_company_name': 'aaa', 'connect_app_description': 'alksjdfl;ajseifj;alsijfl;ajself;jasjfjas;lejflj', @@ -67,7 +67,7 @@ describe('AuthorizedConnectApp', function() { 'get-all' ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('AuthorizedConnectApp', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'authorized_connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -111,7 +111,7 @@ describe('AuthorizedConnectApp', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .authorizedConnectApps.each(() => done()); @@ -119,7 +119,7 @@ describe('AuthorizedConnectApp', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'authorized_connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -147,7 +147,7 @@ describe('AuthorizedConnectApp', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .authorizedConnectApps.each({pageSize: 20}, () => done()); @@ -160,7 +160,7 @@ describe('AuthorizedConnectApp', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'authorized_connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('AuthorizedConnectApp', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .authorizedConnectApps.each({callback: () => done()}, () => fail('wrong callback!')); @@ -196,7 +196,7 @@ describe('AuthorizedConnectApp', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .authorizedConnectApps.list(); @@ -218,7 +218,7 @@ describe('AuthorizedConnectApp', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'authorized_connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -246,7 +246,7 @@ describe('AuthorizedConnectApp', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -262,7 +262,7 @@ describe('AuthorizedConnectApp', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'authorized_connect_apps': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json?Page=0&PageSize=50', @@ -275,7 +275,7 @@ describe('AuthorizedConnectApp', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AuthorizedConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js index 919c8f83d7..692eb4b6da 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber.spec.js @@ -31,7 +31,7 @@ describe('AvailablePhoneNumberCountry', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'beta': false, @@ -54,7 +54,7 @@ describe('AvailablePhoneNumberCountry', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers.each(() => done()); @@ -62,7 +62,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'beta': false, @@ -85,7 +85,7 @@ describe('AvailablePhoneNumberCountry', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers.each({pageSize: 20}, () => done()); @@ -98,7 +98,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'beta': false, @@ -121,7 +121,7 @@ describe('AvailablePhoneNumberCountry', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -129,7 +129,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers.list(); @@ -151,7 +151,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'beta': false, @@ -174,7 +174,7 @@ describe('AvailablePhoneNumberCountry', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -190,7 +190,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [], 'end': 1, 'first_page_uri': null, @@ -203,7 +203,7 @@ describe('AvailablePhoneNumberCountry', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -219,7 +219,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US').fetch(); @@ -242,7 +242,7 @@ describe('AvailablePhoneNumberCountry', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'beta': null, 'country': 'United States', 'country_code': 'US', @@ -251,7 +251,7 @@ describe('AvailablePhoneNumberCountry', function() { 'toll_free': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js index b4e949e1b4..6d7e0cd15b 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/local.spec.js @@ -31,7 +31,7 @@ describe('Local', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -64,7 +64,7 @@ describe('Local', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -73,7 +73,7 @@ describe('Local', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -106,7 +106,7 @@ describe('Local', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -120,7 +120,7 @@ describe('Local', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -153,7 +153,7 @@ describe('Local', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -162,7 +162,7 @@ describe('Local', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -186,7 +186,7 @@ describe('Local', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -219,7 +219,7 @@ describe('Local', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('Local', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=50&Page=0', @@ -248,7 +248,7 @@ describe('Local', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/machineToMachine.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/machineToMachine.spec.js index 9664b63176..6f7e0d3bc5 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/machineToMachine.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/machineToMachine.spec.js @@ -31,7 +31,7 @@ describe('MachineToMachine', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -64,7 +64,7 @@ describe('MachineToMachine', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -73,7 +73,7 @@ describe('MachineToMachine', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -106,7 +106,7 @@ describe('MachineToMachine', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -120,7 +120,7 @@ describe('MachineToMachine', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -153,7 +153,7 @@ describe('MachineToMachine', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -162,7 +162,7 @@ describe('MachineToMachine', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -186,7 +186,7 @@ describe('MachineToMachine', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -219,7 +219,7 @@ describe('MachineToMachine', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('MachineToMachine', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=50&Page=0', @@ -248,7 +248,7 @@ describe('MachineToMachine', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/MachineToMachine.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js index 499367394a..3c5fd9a446 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/mobile.spec.js @@ -31,7 +31,7 @@ describe('Mobile', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -63,7 +63,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -72,7 +72,7 @@ describe('Mobile', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -104,7 +104,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -118,7 +118,7 @@ describe('Mobile', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -150,7 +150,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -159,7 +159,7 @@ describe('Mobile', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -183,7 +183,7 @@ describe('Mobile', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -215,7 +215,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -232,7 +232,7 @@ describe('Mobile', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=50&Page=0', @@ -244,7 +244,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Mobile.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/national.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/national.spec.js index 673501cf17..3500478c04 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/national.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/national.spec.js @@ -31,7 +31,7 @@ describe('National', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -64,7 +64,7 @@ describe('National', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -73,7 +73,7 @@ describe('National', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -106,7 +106,7 @@ describe('National', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -120,7 +120,7 @@ describe('National', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -153,7 +153,7 @@ describe('National', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -162,7 +162,7 @@ describe('National', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -186,7 +186,7 @@ describe('National', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -219,7 +219,7 @@ describe('National', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('National', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=50&Page=0', @@ -248,7 +248,7 @@ describe('National', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/National.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/sharedCost.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/sharedCost.spec.js index e009d94d00..2ed4b1a601 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/sharedCost.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/sharedCost.spec.js @@ -31,7 +31,7 @@ describe('SharedCost', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -64,7 +64,7 @@ describe('SharedCost', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -73,7 +73,7 @@ describe('SharedCost', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -106,7 +106,7 @@ describe('SharedCost', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -120,7 +120,7 @@ describe('SharedCost', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -153,7 +153,7 @@ describe('SharedCost', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -162,7 +162,7 @@ describe('SharedCost', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -186,7 +186,7 @@ describe('SharedCost', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -219,7 +219,7 @@ describe('SharedCost', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('SharedCost', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=50&Page=0', @@ -248,7 +248,7 @@ describe('SharedCost', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/SharedCost.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js index 44188a3520..b6fa438548 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/tollFree.spec.js @@ -31,7 +31,7 @@ describe('TollFree', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -63,7 +63,7 @@ describe('TollFree', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -72,7 +72,7 @@ describe('TollFree', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -104,7 +104,7 @@ describe('TollFree', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -118,7 +118,7 @@ describe('TollFree', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -150,7 +150,7 @@ describe('TollFree', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -159,7 +159,7 @@ describe('TollFree', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -183,7 +183,7 @@ describe('TollFree', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -215,7 +215,7 @@ describe('TollFree', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -232,7 +232,7 @@ describe('TollFree', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=50&Page=0', @@ -244,7 +244,7 @@ describe('TollFree', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/availablePhoneNumber/voip.spec.js b/spec/integration/rest/api/v2010/account/availablePhoneNumber/voip.spec.js index 4d4333188a..6fab9c0e95 100644 --- a/spec/integration/rest/api/v2010/account/availablePhoneNumber/voip.spec.js +++ b/spec/integration/rest/api/v2010/account/availablePhoneNumber/voip.spec.js @@ -31,7 +31,7 @@ describe('Voip', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -64,7 +64,7 @@ describe('Voip', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -73,7 +73,7 @@ describe('Voip', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -106,7 +106,7 @@ describe('Voip', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -120,7 +120,7 @@ describe('Voip', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -153,7 +153,7 @@ describe('Voip', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -162,7 +162,7 @@ describe('Voip', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .availablePhoneNumbers('US') @@ -186,7 +186,7 @@ describe('Voip', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [ { 'address_requirements': 'none', @@ -219,7 +219,7 @@ describe('Voip', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('Voip', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_phone_numbers': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=50&Page=0', @@ -248,7 +248,7 @@ describe('Voip', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AvailablePhoneNumbers/US/Voip.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/balance.spec.js b/spec/integration/rest/api/v2010/account/balance.spec.js index 4f46821f69..850e8ff4bb 100644 --- a/spec/integration/rest/api/v2010/account/balance.spec.js +++ b/spec/integration/rest/api/v2010/account/balance.spec.js @@ -31,7 +31,7 @@ describe('Balance', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .balance.fetch(); @@ -53,11 +53,11 @@ describe('Balance', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'balance': '0.05', 'currency': 'USD' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/call.spec.js b/spec/integration/rest/api/v2010/account/call.spec.js index e87272e39b..49790bab94 100644 --- a/spec/integration/rest/api/v2010/account/call.spec.js +++ b/spec/integration/rest/api/v2010/account/call.spec.js @@ -31,7 +31,7 @@ describe('Call', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: '+15558675310', from: '+15017122661'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Call', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': null, 'answered_by': null, @@ -90,7 +90,7 @@ describe('Call', function() { 'trunk_sid': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(201, body)); @@ -107,7 +107,7 @@ describe('Call', function() { ); it('should generate valid create_with_twiml response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': null, 'answered_by': null, @@ -141,7 +141,7 @@ describe('Call', function() { 'trunk_sid': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(201, body)); @@ -158,7 +158,7 @@ describe('Call', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -181,7 +181,7 @@ describe('Call', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -197,7 +197,7 @@ describe('Call', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -220,7 +220,7 @@ describe('Call', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': 'billingreferencetag', 'answered_by': 'machine_start', @@ -254,7 +254,7 @@ describe('Call', function() { 'trunk_sid': 'TRdeadbeefdeadbeefdeadbeefdeadbeef', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(200, body)); @@ -270,7 +270,7 @@ describe('Call', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -351,7 +351,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls.each(() => done()); @@ -359,7 +359,7 @@ describe('Call', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -440,7 +440,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls.each({pageSize: 20}, () => done()); @@ -453,7 +453,7 @@ describe('Call', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -534,7 +534,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls.each({callback: () => done()}, () => fail('wrong callback!')); @@ -542,7 +542,7 @@ describe('Call', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls.list(); @@ -564,7 +564,7 @@ describe('Call', function() { ); it('should generate valid read_full_page1 response', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -645,7 +645,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&From=%2B987654321&StartTime=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EndTime=2009-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -661,7 +661,7 @@ describe('Call', function() { ); it('should generate valid read_full_page2 response', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -742,7 +742,7 @@ describe('Call', function() { 'previous_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&From=%2B987654321&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&To=%2B123456789&StartTime=2008-01-02&EndTime=2009-01-02&PageSize=2&Page=0&PageToken=PBCAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'start': 2, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&From=%2B987654321&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&To=%2B123456789&StartTime=2008-01-02&EndTime=2009-01-02&PageSize=2&Page=1&PageToken=PACAdeadbeefdeadbeefdeadbeefdeadbeef' - }); + }; holodeck.mock(new Response(200, body)); @@ -758,7 +758,7 @@ describe('Call', function() { ); it('should generate valid read_empty_dates_greater response', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&EndTime%3E=2009-01-02&From=%2B987654321&StartTime%3E=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=2&Page=0', @@ -768,7 +768,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?Status=completed&To=%2B123456789&EndTime%3E=2009-01-02&From=%2B987654321&StartTime%3E=2008-01-02&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -784,7 +784,7 @@ describe('Call', function() { ); it('should generate valid read_empty_dates_less response', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?EndTime%3C=2009-01-02&Status=completed&From=%2B987654321&To=%2B123456789&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartTime%3C=2008-01-02&PageSize=2&Page=0', @@ -794,7 +794,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?EndTime%3C=2009-01-02&Status=completed&From=%2B987654321&To=%2B123456789&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartTime%3C=2008-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -810,7 +810,7 @@ describe('Call', function() { ); it('should generate valid read_empty_date_fun_date_formats response', function(done) { - var body = JSON.stringify({ + var body = { 'calls': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?EndTime%3C=2019-06-11+22%3A05%3A25.000&Status=completed&From=%2B987654321&To=%2B123456789&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartTime%3C=06%2F11%2F2019+22%3A05%3A25+MST&PageSize=2&Page=0', @@ -820,7 +820,7 @@ describe('Call', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls.json?EndTime%3C=2019-06-11+22%3A05%3A25.000&Status=completed&From=%2B987654321&To=%2B123456789&ParentCallSid=CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartTime%3C=06%2F11%2F2019+22%3A05%3A25+MST&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -836,7 +836,7 @@ describe('Call', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -859,7 +859,7 @@ describe('Call', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': null, 'answered_by': null, @@ -893,7 +893,7 @@ describe('Call', function() { 'trunk_sid': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(200, body)); @@ -909,7 +909,7 @@ describe('Call', function() { ); it('should generate valid cancel response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': null, 'answered_by': null, @@ -943,7 +943,7 @@ describe('Call', function() { 'trunk_sid': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(200, body)); @@ -959,7 +959,7 @@ describe('Call', function() { ); it('should generate valid posttwiml response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'annotation': null, 'answered_by': null, @@ -993,7 +993,7 @@ describe('Call', function() { 'trunk_sid': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'queue_time': '1000' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/call/feedback.spec.js b/spec/integration/rest/api/v2010/account/call/feedback.spec.js index fc622a3ca9..d2ea5206dc 100644 --- a/spec/integration/rest/api/v2010/account/call/feedback.spec.js +++ b/spec/integration/rest/api/v2010/account/call/feedback.spec.js @@ -31,7 +31,7 @@ describe('Feedback', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('Feedback', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 20 Aug 2015 21:45:46 +0000', 'date_updated': 'Thu, 20 Aug 2015 21:45:46 +0000', @@ -68,7 +68,7 @@ describe('Feedback', function() { ], 'quality_score': 5, 'sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -86,7 +86,7 @@ describe('Feedback', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -110,7 +110,7 @@ describe('Feedback', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 20 Aug 2015 21:45:46 +0000', 'date_updated': 'Thu, 20 Aug 2015 21:45:46 +0000', @@ -120,7 +120,7 @@ describe('Feedback', function() { ], 'quality_score': 5, 'sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -137,7 +137,7 @@ describe('Feedback', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {qualityScore: 1}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -164,7 +164,7 @@ describe('Feedback', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 20 Aug 2015 21:45:46 +0000', 'date_updated': 'Thu, 20 Aug 2015 21:45:46 +0000', @@ -174,7 +174,7 @@ describe('Feedback', function() { ], 'quality_score': 5, 'sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js b/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js index ef7850fa50..e19d6a04a3 100644 --- a/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js +++ b/spec/integration/rest/api/v2010/account/call/feedbackSummary.spec.js @@ -33,7 +33,7 @@ describe('FeedbackSummary', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {startDate: new Date(Date.UTC(2008, 0, 2)), endDate: new Date(Date.UTC(2008, 0, 2))}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -62,7 +62,7 @@ describe('FeedbackSummary', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_count': 10200, 'call_feedback_count': 729, @@ -83,7 +83,7 @@ describe('FeedbackSummary', function() { 'status': 'completed', 'date_created': 'Tue, 31 Aug 2010 20:36:28 +0000', 'date_updated': 'Tue, 31 Aug 2010 20:36:44 +0000' - }); + }; holodeck.mock(new Response(201, body)); @@ -101,7 +101,7 @@ describe('FeedbackSummary', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls @@ -125,7 +125,7 @@ describe('FeedbackSummary', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_count': 10200, 'call_feedback_count': 729, @@ -146,7 +146,7 @@ describe('FeedbackSummary', function() { 'status': 'completed', 'date_created': 'Tue, 31 Aug 2010 20:36:28 +0000', 'date_updated': 'Tue, 31 Aug 2010 20:36:44 +0000' - }); + }; holodeck.mock(new Response(200, body)); @@ -163,7 +163,7 @@ describe('FeedbackSummary', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls @@ -187,7 +187,7 @@ describe('FeedbackSummary', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/call/notification.spec.js b/spec/integration/rest/api/v2010/account/call/notification.spec.js index 9df14ae406..c3c02f66b9 100644 --- a/spec/integration/rest/api/v2010/account/call/notification.spec.js +++ b/spec/integration/rest/api/v2010/account/call/notification.spec.js @@ -31,7 +31,7 @@ describe('Notification', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Notification', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2008-08-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -74,7 +74,7 @@ describe('Notification', function() { 'response_headers': '', 'sid': 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('Notification', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'notifications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -118,7 +118,7 @@ describe('Notification', function() { 'next_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -127,7 +127,7 @@ describe('Notification', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'notifications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -154,7 +154,7 @@ describe('Notification', function() { 'next_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -168,7 +168,7 @@ describe('Notification', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'notifications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -195,7 +195,7 @@ describe('Notification', function() { 'next_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -204,7 +204,7 @@ describe('Notification', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -228,7 +228,7 @@ describe('Notification', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'notifications': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -255,7 +255,7 @@ describe('Notification', function() { 'next_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -272,7 +272,7 @@ describe('Notification', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'notifications': [], 'page': 0, 'page_size': 50, @@ -282,7 +282,7 @@ describe('Notification', function() { 'next_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/call/payment.spec.js b/spec/integration/rest/api/v2010/account/call/payment.spec.js index 4978df111d..4d66f118e2 100644 --- a/spec/integration/rest/api/v2010/account/call/payment.spec.js +++ b/spec/integration/rest/api/v2010/account/call/payment.spec.js @@ -31,7 +31,7 @@ describe('Payment', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {idempotencyKey: 'idempotency_key', statusCallback: 'https://example.com'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,14 +58,14 @@ describe('Payment', function() { ); it('should generate valid start_payment_session_success response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 18 Dec 2019 20:02:01 +0000', 'date_updated': 'Wed, 18 Dec 2019 20:02:01 +0000', 'sid': 'PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -83,7 +83,7 @@ describe('Payment', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {idempotencyKey: 'idempotency_key', statusCallback: 'https://example.com'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,14 +111,14 @@ describe('Payment', function() { ); it('should generate valid collect_credit_card_number response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 18 Dec 2019 20:02:01 +0000', 'date_updated': 'Wed, 18 Dec 2019 20:02:01 +0000', 'sid': 'PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -136,14 +136,14 @@ describe('Payment', function() { ); it('should generate valid collect_credit_card_expiry_date response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 18 Dec 2019 20:02:01 +0000', 'date_updated': 'Wed, 18 Dec 2019 20:02:01 +0000', 'sid': 'PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -161,14 +161,14 @@ describe('Payment', function() { ); it('should generate valid complete_payment response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 18 Dec 2019 20:02:01 +0000', 'date_updated': 'Wed, 18 Dec 2019 20:02:01 +0000', 'sid': 'PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payments/PKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/call/recording.spec.js b/spec/integration/rest/api/v2010/account/call/recording.spec.js index 84fd141781..4f3f42745b 100644 --- a/spec/integration/rest/api/v2010/account/call/recording.spec.js +++ b/spec/integration/rest/api/v2010/account/call/recording.spec.js @@ -31,7 +31,7 @@ describe('Recording', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('Recording', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -73,7 +73,7 @@ describe('Recording', function() { 'error_code': null, 'encryption_details': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -90,7 +90,7 @@ describe('Recording', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {status: 'in-progress'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -118,7 +118,7 @@ describe('Recording', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -136,7 +136,7 @@ describe('Recording', function() { 'error_code': null, 'encryption_details': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -154,7 +154,7 @@ describe('Recording', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -179,7 +179,7 @@ describe('Recording', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -201,7 +201,7 @@ describe('Recording', function() { 'status': 'completed', 'error_code': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -218,7 +218,7 @@ describe('Recording', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -243,7 +243,7 @@ describe('Recording', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -260,7 +260,7 @@ describe('Recording', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -294,7 +294,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -303,7 +303,7 @@ describe('Recording', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -337,7 +337,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -351,7 +351,7 @@ describe('Recording', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -385,7 +385,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -394,7 +394,7 @@ describe('Recording', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -418,7 +418,7 @@ describe('Recording', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -452,7 +452,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -469,7 +469,7 @@ describe('Recording', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -479,7 +479,7 @@ describe('Recording', function() { 'recordings': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Calls/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/conference.spec.js b/spec/integration/rest/api/v2010/account/conference.spec.js index 486b3f2fab..111a1209a8 100644 --- a/spec/integration/rest/api/v2010/account/conference.spec.js +++ b/spec/integration/rest/api/v2010/account/conference.spec.js @@ -31,7 +31,7 @@ describe('Conference', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Conference', function() { ); it('should generate valid fetch_valid_mixer_zone response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Fri, 18 Feb 2011 19:26:50 +0000', @@ -68,7 +68,7 @@ describe('Conference', function() { 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Conference', function() { ); it('should generate valid fetch_valid_region_in_progress response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Fri, 18 Feb 2011 19:26:50 +0000', @@ -98,7 +98,7 @@ describe('Conference', function() { 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -114,7 +114,7 @@ describe('Conference', function() { ); it('should generate valid fetch_without_mixer_zone_integer_status response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Fri, 18 Feb 2011 19:26:50 +0000', @@ -128,7 +128,7 @@ describe('Conference', function() { 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -144,7 +144,7 @@ describe('Conference', function() { ); it('should generate valid fetch_unknown_mixer_zone_init_integer_status response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Fri, 18 Feb 2011 19:26:50 +0000', @@ -158,7 +158,7 @@ describe('Conference', function() { 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -174,7 +174,7 @@ describe('Conference', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -230,7 +230,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 0, 'end': 2 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences.each(() => done()); @@ -238,7 +238,7 @@ describe('Conference', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -294,7 +294,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 0, 'end': 2 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences.each({pageSize: 20}, () => done()); @@ -307,7 +307,7 @@ describe('Conference', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -363,7 +363,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 0, 'end': 2 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences.each({callback: () => done()}, () => fail('wrong callback!')); @@ -371,7 +371,7 @@ describe('Conference', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences.list(); @@ -393,7 +393,7 @@ describe('Conference', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences.json?Status=init&DateUpdated%3E=2018-11-12&DateUpdated%3C=2018-11-11&DateCreated=2008-01-03&FriendlyName=friendly_name&DateUpdated=2018-11-13&DateCreated%3C=2008-01-01&DateCreated%3E=2008-01-02&PageSize=50&Page=0', 'next_page_uri': null, @@ -403,7 +403,7 @@ describe('Conference', function() { 'page_size': 50, 'start': 0, 'end': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -419,7 +419,7 @@ describe('Conference', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -475,7 +475,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 0, 'end': 2 - }); + }; holodeck.mock(new Response(200, body)); @@ -491,7 +491,7 @@ describe('Conference', function() { ); it('should generate valid read_next response', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -547,7 +547,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 3, 'end': 5 - }); + }; holodeck.mock(new Response(200, body)); @@ -563,7 +563,7 @@ describe('Conference', function() { ); it('should generate valid read_previous response', function(done) { - var body = JSON.stringify({ + var body = { 'conferences': [ { 'status': 'in-progress', @@ -619,7 +619,7 @@ describe('Conference', function() { 'page_size': 3, 'start': 0, 'end': 2 - }); + }; holodeck.mock(new Response(200, body)); @@ -635,7 +635,7 @@ describe('Conference', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -658,7 +658,7 @@ describe('Conference', function() { ); it('should generate valid update_end_conference response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': 'Mon, 22 Aug 2011 20:58:45 +0000', @@ -672,7 +672,7 @@ describe('Conference', function() { 'recordings': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/conference/participant.spec.js b/spec/integration/rest/api/v2010/account/conference/participant.spec.js index 1ce66c0196..ac33d5a1bd 100644 --- a/spec/integration/rest/api/v2010/account/conference/participant.spec.js +++ b/spec/integration/rest/api/v2010/account/conference/participant.spec.js @@ -31,7 +31,7 @@ describe('Participant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Participant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -70,7 +70,7 @@ describe('Participant', function() { 'coaching': true, 'call_sid_to_coach': 'CAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Participant', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Participant', function() { ); it('should generate valid mute_participant response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -126,7 +126,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -143,7 +143,7 @@ describe('Participant', function() { ); it('should generate valid modify_participant response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -157,7 +157,7 @@ describe('Participant', function() { 'coaching': true, 'call_sid_to_coach': 'CAbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -174,7 +174,7 @@ describe('Participant', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {from: '+15017122661', to: '+15558675310'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -201,7 +201,7 @@ describe('Participant', function() { ); it('should generate valid create_with_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -233,7 +233,7 @@ describe('Participant', function() { ); it('should generate valid create_with_friendly_name response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -247,7 +247,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -265,7 +265,7 @@ describe('Participant', function() { ); it('should generate valid create_with_sid_as_coach response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -279,7 +279,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -297,7 +297,7 @@ describe('Participant', function() { ); it('should generate valid create_with_non_e164_number response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -311,7 +311,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -329,7 +329,7 @@ describe('Participant', function() { ); it('should generate valid create_with_friendly_name_byoc response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conference_sid': 'CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -343,7 +343,7 @@ describe('Participant', function() { 'coaching': false, 'call_sid_to_coach': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -361,7 +361,7 @@ describe('Participant', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -386,7 +386,7 @@ describe('Participant', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -403,7 +403,7 @@ describe('Participant', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -444,7 +444,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 0, 'end': 1 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -453,7 +453,7 @@ describe('Participant', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -494,7 +494,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 0, 'end': 1 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -508,7 +508,7 @@ describe('Participant', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -549,7 +549,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 0, 'end': 1 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -558,7 +558,7 @@ describe('Participant', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -582,7 +582,7 @@ describe('Participant', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants.json?Hold=True&PageSize=50&Page=0', 'next_page_uri': null, @@ -592,7 +592,7 @@ describe('Participant', function() { 'page_size': 50, 'end': 0, 'start': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -609,7 +609,7 @@ describe('Participant', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -650,7 +650,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 0, 'end': 1 - }); + }; holodeck.mock(new Response(200, body)); @@ -667,7 +667,7 @@ describe('Participant', function() { ); it('should generate valid read_next response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -708,7 +708,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 2, 'end': 3 - }); + }; holodeck.mock(new Response(200, body)); @@ -725,7 +725,7 @@ describe('Participant', function() { ); it('should generate valid read_previous response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -766,7 +766,7 @@ describe('Participant', function() { 'page_size': 2, 'start': 0, 'end': 1 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/conference/recording.spec.js b/spec/integration/rest/api/v2010/account/conference/recording.spec.js index 3162157930..bfbd111bb5 100644 --- a/spec/integration/rest/api/v2010/account/conference/recording.spec.js +++ b/spec/integration/rest/api/v2010/account/conference/recording.spec.js @@ -31,7 +31,7 @@ describe('Recording', function() { }); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {status: 'in-progress'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -59,7 +59,7 @@ describe('Recording', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -77,7 +77,7 @@ describe('Recording', function() { 'error_code': null, 'encryption_details': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -95,7 +95,7 @@ describe('Recording', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -120,7 +120,7 @@ describe('Recording', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -142,7 +142,7 @@ describe('Recording', function() { 'encryption_iv': '8I2hhNIYNTrwxfHk' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -159,7 +159,7 @@ describe('Recording', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -184,7 +184,7 @@ describe('Recording', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -201,7 +201,7 @@ describe('Recording', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -235,7 +235,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -244,7 +244,7 @@ describe('Recording', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -278,7 +278,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -292,7 +292,7 @@ describe('Recording', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -326,7 +326,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -335,7 +335,7 @@ describe('Recording', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .conferences('CFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -359,7 +359,7 @@ describe('Recording', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -393,7 +393,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -410,7 +410,7 @@ describe('Recording', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -420,7 +420,7 @@ describe('Recording', function() { 'recordings': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Conferences/CFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/connectApp.spec.js b/spec/integration/rest/api/v2010/account/connectApp.spec.js index bf3f0bd111..251b9748f3 100644 --- a/spec/integration/rest/api/v2010/account/connectApp.spec.js +++ b/spec/integration/rest/api/v2010/account/connectApp.spec.js @@ -31,7 +31,7 @@ describe('ConnectApp', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('ConnectApp', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'authorize_redirect_url': 'http://example.com/redirect', 'company_name': 'Twilio', @@ -66,7 +66,7 @@ describe('ConnectApp', function() { 'permissions': [], 'sid': 'CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -82,7 +82,7 @@ describe('ConnectApp', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -105,7 +105,7 @@ describe('ConnectApp', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'authorize_redirect_url': 'http://example.com/redirect', 'company_name': 'Twilio', @@ -117,7 +117,7 @@ describe('ConnectApp', function() { 'permissions': [], 'sid': 'CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps/CNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -133,7 +133,7 @@ describe('ConnectApp', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -157,7 +157,7 @@ describe('ConnectApp', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps.each(() => done()); @@ -165,7 +165,7 @@ describe('ConnectApp', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -189,7 +189,7 @@ describe('ConnectApp', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps.each({pageSize: 20}, () => done()); @@ -202,7 +202,7 @@ describe('ConnectApp', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -226,7 +226,7 @@ describe('ConnectApp', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps.each({callback: () => done()}, () => fail('wrong callback!')); @@ -234,7 +234,7 @@ describe('ConnectApp', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps.list(); @@ -256,7 +256,7 @@ describe('ConnectApp', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'connect_apps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -280,7 +280,7 @@ describe('ConnectApp', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('ConnectApp', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'connect_apps': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json?Page=0&PageSize=50', @@ -306,7 +306,7 @@ describe('ConnectApp', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ConnectApps.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -322,7 +322,7 @@ describe('ConnectApp', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .connectApps('CNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -345,7 +345,7 @@ describe('ConnectApp', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js index be1fe174bd..dfa24f61e8 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber.spec.js @@ -31,7 +31,7 @@ describe('IncomingPhoneNumber', function() { }); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -54,7 +54,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -90,7 +90,7 @@ describe('IncomingPhoneNumber', function() { 'voice_method': 'POST', 'voice_url': null, 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -106,7 +106,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -129,7 +129,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('IncomingPhoneNumber', function() { 'voice_method': 'POST', 'voice_url': null, 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -181,7 +181,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -204,7 +204,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -220,7 +220,7 @@ describe('IncomingPhoneNumber', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -271,7 +271,7 @@ describe('IncomingPhoneNumber', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers.each(() => done()); @@ -279,7 +279,7 @@ describe('IncomingPhoneNumber', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -330,7 +330,7 @@ describe('IncomingPhoneNumber', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers.each({pageSize: 20}, () => done()); @@ -343,7 +343,7 @@ describe('IncomingPhoneNumber', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -394,7 +394,7 @@ describe('IncomingPhoneNumber', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -402,7 +402,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers.list(); @@ -424,7 +424,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -475,7 +475,7 @@ describe('IncomingPhoneNumber', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -491,7 +491,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1&Page=0', 'incoming_phone_numbers': [], @@ -504,7 +504,7 @@ describe('IncomingPhoneNumber', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -520,7 +520,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers.create(); @@ -542,7 +542,7 @@ describe('IncomingPhoneNumber', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -578,7 +578,7 @@ describe('IncomingPhoneNumber', function() { 'voice_method': 'POST', 'voice_url': null, 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js index d512975d04..6c3ed3dcbf 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn.spec.js @@ -31,7 +31,7 @@ describe('AssignedAddOn', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'resource_sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('AssignedAddOn', function() { 'subresource_uris': { 'extensions': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -89,7 +89,7 @@ describe('AssignedAddOn', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -117,7 +117,7 @@ describe('AssignedAddOn', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -126,7 +126,7 @@ describe('AssignedAddOn', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -154,7 +154,7 @@ describe('AssignedAddOn', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -168,7 +168,7 @@ describe('AssignedAddOn', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -196,7 +196,7 @@ describe('AssignedAddOn', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -205,7 +205,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -229,7 +229,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -257,7 +257,7 @@ describe('AssignedAddOn', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -274,7 +274,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -284,7 +284,7 @@ describe('AssignedAddOn', function() { 'assigned_add_ons': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {installedAddOnSid: 'XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -328,7 +328,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'resource_sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -344,7 +344,7 @@ describe('AssignedAddOn', function() { 'subresource_uris': { 'extensions': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json' } - }); + }; holodeck.mock(new Response(201, body)); @@ -362,7 +362,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -387,7 +387,7 @@ describe('AssignedAddOn', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.spec.js index 3882f3c0a2..c9db0456d9 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/assignedAddOn/assignedAddOnExtension.spec.js @@ -31,7 +31,7 @@ describe('AssignedAddOnExtension', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('AssignedAddOnExtension', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assigned_add_on_sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'resource_sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('AssignedAddOnExtension', function() { 'unique_name': 'voice-incoming', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'enabled': true - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('AssignedAddOnExtension', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -108,7 +108,7 @@ describe('AssignedAddOnExtension', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -118,7 +118,7 @@ describe('AssignedAddOnExtension', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -140,7 +140,7 @@ describe('AssignedAddOnExtension', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('AssignedAddOnExtension', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -177,7 +177,7 @@ describe('AssignedAddOnExtension', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -187,7 +187,7 @@ describe('AssignedAddOnExtension', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -213,7 +213,7 @@ describe('AssignedAddOnExtension', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -235,7 +235,7 @@ describe('AssignedAddOnExtension', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -253,7 +253,7 @@ describe('AssignedAddOnExtension', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -263,7 +263,7 @@ describe('AssignedAddOnExtension', function() { 'extensions': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AssignedAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js index 868b9e1690..360940908e 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/local.spec.js @@ -31,7 +31,7 @@ describe('Local', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -82,7 +82,7 @@ describe('Local', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -91,7 +91,7 @@ describe('Local', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -142,7 +142,7 @@ describe('Local', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -156,7 +156,7 @@ describe('Local', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -207,7 +207,7 @@ describe('Local', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -216,7 +216,7 @@ describe('Local', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -239,7 +239,7 @@ describe('Local', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -290,7 +290,7 @@ describe('Local', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -307,7 +307,7 @@ describe('Local', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1&Page=0', 'incoming_phone_numbers': [], @@ -320,7 +320,7 @@ describe('Local', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Local.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Local', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumber: '+15017122661'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -363,7 +363,7 @@ describe('Local', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -399,7 +399,7 @@ describe('Local', function() { 'emergency_status': 'Active', 'emergency_address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js index 8f090860c0..1ee93f64f0 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/mobile.spec.js @@ -31,7 +31,7 @@ describe('Mobile', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50', 'incoming_phone_numbers': [ @@ -82,7 +82,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -91,7 +91,7 @@ describe('Mobile', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50', 'incoming_phone_numbers': [ @@ -142,7 +142,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -156,7 +156,7 @@ describe('Mobile', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50', 'incoming_phone_numbers': [ @@ -207,7 +207,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -216,7 +216,7 @@ describe('Mobile', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -239,7 +239,7 @@ describe('Mobile', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50', 'incoming_phone_numbers': [ @@ -290,7 +290,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -307,7 +307,7 @@ describe('Mobile', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json?Page=0&PageSize=50', 'incoming_phone_numbers': [], @@ -320,7 +320,7 @@ describe('Mobile', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/Mobile.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Mobile', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumber: '+15017122661'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -363,7 +363,7 @@ describe('Mobile', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -399,7 +399,7 @@ describe('Mobile', function() { 'emergency_status': 'Active', 'emergency_address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js index 33b5b7446e..bdd844fd37 100644 --- a/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js +++ b/spec/integration/rest/api/v2010/account/incomingPhoneNumber/tollFree.spec.js @@ -31,7 +31,7 @@ describe('TollFree', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -82,7 +82,7 @@ describe('TollFree', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -91,7 +91,7 @@ describe('TollFree', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -142,7 +142,7 @@ describe('TollFree', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -156,7 +156,7 @@ describe('TollFree', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -207,7 +207,7 @@ describe('TollFree', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -216,7 +216,7 @@ describe('TollFree', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .incomingPhoneNumbers @@ -239,7 +239,7 @@ describe('TollFree', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0', 'incoming_phone_numbers': [ @@ -290,7 +290,7 @@ describe('TollFree', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -307,7 +307,7 @@ describe('TollFree', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1&Page=0', 'incoming_phone_numbers': [], @@ -320,7 +320,7 @@ describe('TollFree', function() { 'start': 0, 'total': 3, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/TollFree.json?PageSize=1' - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('TollFree', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumber: '+15017122661'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -363,7 +363,7 @@ describe('TollFree', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_requirements': 'none', 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -399,7 +399,7 @@ describe('TollFree', function() { 'emergency_status': 'Active', 'emergency_address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/key.spec.js b/spec/integration/rest/api/v2010/account/key.spec.js index a66abd03d4..d66821e20f 100644 --- a/spec/integration/rest/api/v2010/account/key.spec.js +++ b/spec/integration/rest/api/v2010/account/key.spec.js @@ -31,7 +31,7 @@ describe('Key', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,12 +54,12 @@ describe('Key', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000' - }); + }; holodeck.mock(new Response(200, body)); @@ -75,7 +75,7 @@ describe('Key', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -98,12 +98,12 @@ describe('Key', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000' - }); + }; holodeck.mock(new Response(200, body)); @@ -119,7 +119,7 @@ describe('Key', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -142,7 +142,7 @@ describe('Key', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -158,7 +158,7 @@ describe('Key', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -175,7 +175,7 @@ describe('Key', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each(() => done()); @@ -183,7 +183,7 @@ describe('Key', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -200,7 +200,7 @@ describe('Key', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each({pageSize: 20}, () => done()); @@ -213,7 +213,7 @@ describe('Key', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -230,7 +230,7 @@ describe('Key', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each({callback: () => done()}, () => fail('wrong callback!')); @@ -238,7 +238,7 @@ describe('Key', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.list(); @@ -260,7 +260,7 @@ describe('Key', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -277,7 +277,7 @@ describe('Key', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -293,7 +293,7 @@ describe('Key', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys.json?PageSize=50&Page=0', 'end': 0, @@ -303,7 +303,7 @@ describe('Key', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/message.spec.js b/spec/integration/rest/api/v2010/account/message.spec.js index b503092e46..bbb4218583 100644 --- a/spec/integration/rest/api/v2010/account/message.spec.js +++ b/spec/integration/rest/api/v2010/account/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: '+15558675310'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'body': 'Hello! \ud83d\udc4d', @@ -79,7 +79,7 @@ describe('Message', function() { }, 'to': '+14155552345', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -96,7 +96,7 @@ describe('Message', function() { ); it('should generate valid create_wo_service response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'body': 'Hello! \ud83d\udc4d', @@ -119,7 +119,7 @@ describe('Message', function() { }, 'to': '+14155552345', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -136,7 +136,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -159,7 +159,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -175,7 +175,7 @@ describe('Message', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -198,7 +198,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'body': 'testing', @@ -222,7 +222,7 @@ describe('Message', function() { }, 'to': '+18182008801', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMb7c0a2ce80504485a6f653a7110836f5.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -238,7 +238,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 1, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0', 'next_page_uri': null, @@ -299,7 +299,7 @@ describe('Message', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each(() => done()); @@ -307,7 +307,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 1, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0', 'next_page_uri': null, @@ -368,7 +368,7 @@ describe('Message', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each({pageSize: 20}, () => done()); @@ -381,7 +381,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 1, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0', 'next_page_uri': null, @@ -442,7 +442,7 @@ describe('Message', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each({callback: () => done()}, () => fail('wrong callback!')); @@ -450,7 +450,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.list(); @@ -472,7 +472,7 @@ describe('Message', function() { ); it('should generate valid read_full_page1 response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 1, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0', 'next_page_uri': null, @@ -533,7 +533,7 @@ describe('Message', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=2&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -549,7 +549,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_less response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3C=2008-01-02&PageSize=25&Page=0', 'next_page_uri': null, @@ -559,7 +559,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3C=2008-01-02&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -575,7 +575,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_equals response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent=2008-01-02&PageSize=25&Page=0', 'next_page_uri': null, @@ -585,7 +585,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent=2008-01-02&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -601,7 +601,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_greater response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=25&Page=0', 'next_page_uri': null, @@ -611,7 +611,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2008-01-02&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -627,7 +627,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_greater_format1 response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=06%2F11%2F2019+22%3A05%3A25+MST&PageSize=25&Page=0', 'next_page_uri': null, @@ -637,7 +637,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=06%2F11%2F2019+22%3A05%3A25+MST&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -653,7 +653,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_greater_format2 response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2019-06-11+22%3A05%3A25.000&PageSize=25&Page=0', 'next_page_uri': null, @@ -663,7 +663,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=2019-06-11+22%3A05%3A25.000&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -679,7 +679,7 @@ describe('Message', function() { ); it('should generate valid read_empty_sentdate_greater_format3 response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=Wed%2C+19+Jun+2019+22%3A04%3A00+-0000&PageSize=25&Page=0', 'next_page_uri': null, @@ -689,7 +689,7 @@ describe('Message', function() { 'messages': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages.json?To=%2B123456789&From=%2B987654321&DateSent%3E=Wed%2C+19+Jun+2019+22%3A04%3A00+-0000&PageSize=25&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -705,7 +705,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {body: 'body'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -731,7 +731,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'body': 'Hello, this is trash Benson cut and pasted and probably does not do anything useful! \ud83d\udc4d', @@ -754,7 +754,7 @@ describe('Message', function() { }, 'to': '+14155552345', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/message/feedback.spec.js b/spec/integration/rest/api/v2010/account/message/feedback.spec.js index d49fb061c1..6494f56802 100644 --- a/spec/integration/rest/api/v2010/account/message/feedback.spec.js +++ b/spec/integration/rest/api/v2010/account/message/feedback.spec.js @@ -31,7 +31,7 @@ describe('Feedback', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,14 +55,14 @@ describe('Feedback', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'message_sid': 'MMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'outcome': 'confirmed', 'uri': 'uri' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/message/media.spec.js b/spec/integration/rest/api/v2010/account/message/media.spec.js index ef998b3f82..b7ed849f8e 100644 --- a/spec/integration/rest/api/v2010/account/message/media.spec.js +++ b/spec/integration/rest/api/v2010/account/message/media.spec.js @@ -31,7 +31,7 @@ describe('Media', function() { }); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Media', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -73,7 +73,7 @@ describe('Media', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -98,7 +98,7 @@ describe('Media', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'content_type': 'image/jpeg', 'date_created': 'Sun, 16 Aug 2015 15:53:54 +0000', @@ -106,7 +106,7 @@ describe('Media', function() { 'parent_sid': 'SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -123,7 +123,7 @@ describe('Media', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', @@ -146,7 +146,7 @@ describe('Media', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Media', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', @@ -178,7 +178,7 @@ describe('Media', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -192,7 +192,7 @@ describe('Media', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', @@ -215,7 +215,7 @@ describe('Media', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('Media', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('MMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('Media', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', @@ -271,7 +271,7 @@ describe('Media', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -288,7 +288,7 @@ describe('Media', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0', @@ -301,7 +301,7 @@ describe('Media', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/SMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/newKey.spec.js b/spec/integration/rest/api/v2010/account/newKey.spec.js index 24be9143d6..53eb48cbeb 100644 --- a/spec/integration/rest/api/v2010/account/newKey.spec.js +++ b/spec/integration/rest/api/v2010/account/newKey.spec.js @@ -31,7 +31,7 @@ describe('NewKey', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .newKeys.create(); @@ -53,13 +53,13 @@ describe('NewKey', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000', 'secret': 'foobar' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/newSigningKey.spec.js b/spec/integration/rest/api/v2010/account/newSigningKey.spec.js index 702455fd38..7fb0b1fb50 100644 --- a/spec/integration/rest/api/v2010/account/newSigningKey.spec.js +++ b/spec/integration/rest/api/v2010/account/newSigningKey.spec.js @@ -31,7 +31,7 @@ describe('NewSigningKey', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .newSigningKeys.create(); @@ -53,13 +53,13 @@ describe('NewSigningKey', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000', 'secret': 'foobar' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/notification.spec.js b/spec/integration/rest/api/v2010/account/notification.spec.js index 0a870b86f9..9d2930f9e3 100644 --- a/spec/integration/rest/api/v2010/account/notification.spec.js +++ b/spec/integration/rest/api/v2010/account/notification.spec.js @@ -31,7 +31,7 @@ describe('Notification', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications('NOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Notification', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2008-08-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('Notification', function() { 'response_headers': 'Date=Mon%2C+13+Sep+2010+20%3A02%3A00+GMT&Content-Length=466&Connection=close&Content-Type=text%2Fhtml%3B+charset%3DUTF-8&Server=Google+Frontend', 'sid': 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -88,7 +88,7 @@ describe('Notification', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0', 'previous_page_uri': null, @@ -115,7 +115,7 @@ describe('Notification', function() { 'page_size': 1, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications.each(() => done()); @@ -123,7 +123,7 @@ describe('Notification', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0', 'previous_page_uri': null, @@ -150,7 +150,7 @@ describe('Notification', function() { 'page_size': 1, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications.each({pageSize: 20}, () => done()); @@ -163,7 +163,7 @@ describe('Notification', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0', 'previous_page_uri': null, @@ -190,7 +190,7 @@ describe('Notification', function() { 'page_size': 1, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications.each({callback: () => done()}, () => fail('wrong callback!')); @@ -198,7 +198,7 @@ describe('Notification', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications.list(); @@ -220,7 +220,7 @@ describe('Notification', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0', 'previous_page_uri': null, @@ -247,7 +247,7 @@ describe('Notification', function() { 'page_size': 1, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -263,7 +263,7 @@ describe('Notification', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -273,7 +273,7 @@ describe('Notification', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Notifications.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js b/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js index e7dcda39c2..73557c9ffd 100644 --- a/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js +++ b/spec/integration/rest/api/v2010/account/outgoingCallerId.spec.js @@ -31,7 +31,7 @@ describe('OutgoingCallerId', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 21 Aug 2009 00:11:24 +0000', 'date_updated': 'Fri, 21 Aug 2009 00:11:24 +0000', @@ -62,7 +62,7 @@ describe('OutgoingCallerId', function() { 'phone_number': '+141586753096', 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -101,7 +101,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 21 Aug 2009 00:11:24 +0000', 'date_updated': 'Fri, 21 Aug 2009 00:11:24 +0000', @@ -109,7 +109,7 @@ describe('OutgoingCallerId', function() { 'phone_number': '+141586753096', 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -125,7 +125,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -148,7 +148,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -164,7 +164,7 @@ describe('OutgoingCallerId', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', @@ -187,7 +187,7 @@ describe('OutgoingCallerId', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds.each(() => done()); @@ -195,7 +195,7 @@ describe('OutgoingCallerId', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', @@ -218,7 +218,7 @@ describe('OutgoingCallerId', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds.each({pageSize: 20}, () => done()); @@ -231,7 +231,7 @@ describe('OutgoingCallerId', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', @@ -254,7 +254,7 @@ describe('OutgoingCallerId', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds.each({callback: () => done()}, () => fail('wrong callback!')); @@ -262,7 +262,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .outgoingCallerIds.list(); @@ -284,7 +284,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', @@ -307,7 +307,7 @@ describe('OutgoingCallerId', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -323,7 +323,7 @@ describe('OutgoingCallerId', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json?Page=0&PageSize=50', @@ -336,7 +336,7 @@ describe('OutgoingCallerId', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OutgoingCallerIds.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/queue.spec.js b/spec/integration/rest/api/v2010/account/queue.spec.js index 41cee3a354..9b923da0df 100644 --- a/spec/integration/rest/api/v2010/account/queue.spec.js +++ b/spec/integration/rest/api/v2010/account/queue.spec.js @@ -31,7 +31,7 @@ describe('Queue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Queue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'average_wait_time': 0, 'current_size': 0, @@ -67,7 +67,7 @@ describe('Queue', function() { 'subresource_uris': { 'members': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Queue', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -106,7 +106,7 @@ describe('Queue', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'average_wait_time': 0, 'current_size': 0, @@ -119,7 +119,7 @@ describe('Queue', function() { 'subresource_uris': { 'members': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -135,7 +135,7 @@ describe('Queue', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -158,7 +158,7 @@ describe('Queue', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -174,7 +174,7 @@ describe('Queue', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -199,7 +199,7 @@ describe('Queue', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues.each(() => done()); @@ -207,7 +207,7 @@ describe('Queue', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -232,7 +232,7 @@ describe('Queue', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues.each({pageSize: 20}, () => done()); @@ -245,7 +245,7 @@ describe('Queue', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -270,7 +270,7 @@ describe('Queue', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues.each({callback: () => done()}, () => fail('wrong callback!')); @@ -278,7 +278,7 @@ describe('Queue', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues.list(); @@ -300,7 +300,7 @@ describe('Queue', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -325,7 +325,7 @@ describe('Queue', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -341,7 +341,7 @@ describe('Queue', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -351,7 +351,7 @@ describe('Queue', function() { 'queues': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -367,7 +367,7 @@ describe('Queue', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -392,7 +392,7 @@ describe('Queue', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'average_wait_time': 0, 'current_size': 0, @@ -405,7 +405,7 @@ describe('Queue', function() { 'subresource_uris': { 'members': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json' } - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/queue/member.spec.js b/spec/integration/rest/api/v2010/account/queue/member.spec.js index ad4d876766..bd4d4189ea 100644 --- a/spec/integration/rest/api/v2010/account/queue/member.spec.js +++ b/spec/integration/rest/api/v2010/account/queue/member.spec.js @@ -31,7 +31,7 @@ describe('Member', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,14 +56,14 @@ describe('Member', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'queue_sid': 'QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_enqueued': 'Tue, 07 Aug 2012 22:57:41 +0000', 'position': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'wait_time': 143 - }); + }; holodeck.mock(new Response(200, body)); @@ -80,14 +80,14 @@ describe('Member', function() { ); it('should generate valid fetch_front response', function(done) { - var body = JSON.stringify({ + var body = { 'queue_sid': 'QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_enqueued': 'Tue, 07 Aug 2012 22:57:41 +0000', 'position': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'wait_time': 143 - }); + }; holodeck.mock(new Response(200, body)); @@ -104,7 +104,7 @@ describe('Member', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {url: 'https://example.com'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -132,14 +132,14 @@ describe('Member', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'queue_sid': 'QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_enqueued': 'Thu, 06 Dec 2018 18:42:47 +0000', 'position': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'wait_time': 143 - }); + }; holodeck.mock(new Response(200, body)); @@ -157,14 +157,14 @@ describe('Member', function() { ); it('should generate valid dequeue_front response', function(done) { - var body = JSON.stringify({ + var body = { 'queue_sid': 'QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_enqueued': 'Tue, 07 Aug 2012 22:57:41 +0000', 'position': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'wait_time': 143 - }); + }; holodeck.mock(new Response(200, body)); @@ -182,7 +182,7 @@ describe('Member', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -201,7 +201,7 @@ describe('Member', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -210,7 +210,7 @@ describe('Member', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -229,7 +229,7 @@ describe('Member', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -243,7 +243,7 @@ describe('Member', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -262,7 +262,7 @@ describe('Member', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -271,7 +271,7 @@ describe('Member', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queues('QUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -295,7 +295,7 @@ describe('Member', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -314,7 +314,7 @@ describe('Member', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -331,7 +331,7 @@ describe('Member', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json?Page=0&PageSize=50', 'next_page_uri': null, @@ -341,7 +341,7 @@ describe('Member', function() { 'queue_members': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queues/QUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/recording.spec.js b/spec/integration/rest/api/v2010/account/recording.spec.js index ddeba05e4e..b61007de23 100644 --- a/spec/integration/rest/api/v2010/account/recording.spec.js +++ b/spec/integration/rest/api/v2010/account/recording.spec.js @@ -31,7 +31,7 @@ describe('Recording', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Recording', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -80,7 +80,7 @@ describe('Recording', function() { 'encryption_cek': 'OV4h6zrsxMIW7h0Zfqwfn6TI2GCNl54KALlg8wn8YB8KYZhXt6HlgvBWAmQTlfYVeLWydMiCewY0YkDDT1xmNe5huEo9vjuKBS5OmYK4CZkSx1NVv3XOGrZHpd2Pl/5WJHVhUK//AUO87uh5qnUP2E0KoLh1nyCLeGcEkXU0RfpPn/6nxjof/n6m6OzZOyeIRK4Oed5+rEtjqFDfqT0EVKjs6JAxv+f0DCc1xYRHl2yV8bahUPVKs+bHYdy4PVszFKa76M/Uae4jFA9Lv233JqWcxj+K2UoghuGhAFbV/JQIIswY2CBYI8JlVSifSqNEl9vvsTJ8bkVMm3MKbG2P7Q==', 'encryption_iv': '8I2hhNIYNTrwxfHk' } - }); + }; holodeck.mock(new Response(200, body)); @@ -96,7 +96,7 @@ describe('Recording', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -119,7 +119,7 @@ describe('Recording', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -135,7 +135,7 @@ describe('Recording', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -173,7 +173,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each(() => done()); @@ -181,7 +181,7 @@ describe('Recording', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -219,7 +219,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each({pageSize: 20}, () => done()); @@ -232,7 +232,7 @@ describe('Recording', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -270,7 +270,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each({callback: () => done()}, () => fail('wrong callback!')); @@ -278,7 +278,7 @@ describe('Recording', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.list(); @@ -300,7 +300,7 @@ describe('Recording', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -338,7 +338,7 @@ describe('Recording', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -354,7 +354,7 @@ describe('Recording', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0', 'next_page_uri': null, @@ -364,7 +364,7 @@ describe('Recording', function() { 'recordings': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/recording/addOnResult.spec.js b/spec/integration/rest/api/v2010/account/recording/addOnResult.spec.js index b9476346d0..7a4e13a6ac 100644 --- a/spec/integration/rest/api/v2010/account/recording/addOnResult.spec.js +++ b/spec/integration/rest/api/v2010/account/recording/addOnResult.spec.js @@ -31,7 +31,7 @@ describe('AddOnResult', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('AddOnResult', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reference_sid': 'REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('AddOnResult', function() { 'subresource_uris': { 'payloads': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('AddOnResult', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -111,7 +111,7 @@ describe('AddOnResult', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -120,7 +120,7 @@ describe('AddOnResult', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -145,7 +145,7 @@ describe('AddOnResult', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('AddOnResult', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -184,7 +184,7 @@ describe('AddOnResult', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('AddOnResult', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -217,7 +217,7 @@ describe('AddOnResult', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -242,7 +242,7 @@ describe('AddOnResult', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -259,7 +259,7 @@ describe('AddOnResult', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -269,7 +269,7 @@ describe('AddOnResult', function() { 'add_on_results': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -286,7 +286,7 @@ describe('AddOnResult', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -311,7 +311,7 @@ describe('AddOnResult', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/recording/addOnResult/payload.spec.js b/spec/integration/rest/api/v2010/account/recording/addOnResult/payload.spec.js index 5790bd109d..072c48408f 100644 --- a/spec/integration/rest/api/v2010/account/recording/addOnResult/payload.spec.js +++ b/spec/integration/rest/api/v2010/account/recording/addOnResult/payload.spec.js @@ -31,7 +31,7 @@ describe('Payload', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('Payload', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reference_sid': 'REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'add_on_sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('Payload', function() { 'subresource_uris': { 'data': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads/XHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Data.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Payload', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -116,7 +116,7 @@ describe('Payload', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -126,7 +126,7 @@ describe('Payload', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -152,7 +152,7 @@ describe('Payload', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -167,7 +167,7 @@ describe('Payload', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -193,7 +193,7 @@ describe('Payload', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -203,7 +203,7 @@ describe('Payload', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -229,7 +229,7 @@ describe('Payload', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -255,7 +255,7 @@ describe('Payload', function() { ], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -273,7 +273,7 @@ describe('Payload', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -283,7 +283,7 @@ describe('Payload', function() { 'payloads': [], 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AddOnResults/XRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Payloads.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('Payload', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -328,7 +328,7 @@ describe('Payload', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/recording/transcription.spec.js b/spec/integration/rest/api/v2010/account/recording/transcription.spec.js index 71ce3ae31b..1cac73a129 100644 --- a/spec/integration/rest/api/v2010/account/recording/transcription.spec.js +++ b/spec/integration/rest/api/v2010/account/recording/transcription.spec.js @@ -31,7 +31,7 @@ describe('Transcription', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Transcription', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2008-08-01', 'date_created': 'Mon, 22 Aug 2011 20:58:44 +0000', @@ -70,7 +70,7 @@ describe('Transcription', function() { 'transcription_text': 'THIS IS A TEST', 'type': 'fast', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Transcription', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Transcription', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Transcription', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', @@ -158,7 +158,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -167,7 +167,7 @@ describe('Transcription', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', @@ -196,7 +196,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -210,7 +210,7 @@ describe('Transcription', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', @@ -239,7 +239,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('Transcription', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -272,7 +272,7 @@ describe('Transcription', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', @@ -301,7 +301,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -318,7 +318,7 @@ describe('Transcription', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0', @@ -331,7 +331,7 @@ describe('Transcription', function() { 'total': 1, 'transcriptions': [], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/REaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/shortCode.spec.js b/spec/integration/rest/api/v2010/account/shortCode.spec.js index a1484b6706..25cccf3683 100644 --- a/spec/integration/rest/api/v2010/account/shortCode.spec.js +++ b/spec/integration/rest/api/v2010/account/shortCode.spec.js @@ -31,7 +31,7 @@ describe('ShortCode', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('ShortCode', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': null, @@ -67,7 +67,7 @@ describe('ShortCode', function() { 'sms_method': 'POST', 'sms_url': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('ShortCode', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -106,7 +106,7 @@ describe('ShortCode', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'date_created': null, @@ -119,7 +119,7 @@ describe('ShortCode', function() { 'sms_method': 'POST', 'sms_url': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -135,7 +135,7 @@ describe('ShortCode', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', @@ -163,7 +163,7 @@ describe('ShortCode', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each(() => done()); @@ -171,7 +171,7 @@ describe('ShortCode', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', @@ -199,7 +199,7 @@ describe('ShortCode', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({pageSize: 20}, () => done()); @@ -212,7 +212,7 @@ describe('ShortCode', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', @@ -240,7 +240,7 @@ describe('ShortCode', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -248,7 +248,7 @@ describe('ShortCode', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.list(); @@ -270,7 +270,7 @@ describe('ShortCode', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', @@ -298,7 +298,7 @@ describe('ShortCode', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -314,7 +314,7 @@ describe('ShortCode', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json?Page=0&PageSize=50', @@ -327,7 +327,7 @@ describe('ShortCode', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SMS/ShortCodes.json' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/signingKey.spec.js b/spec/integration/rest/api/v2010/account/signingKey.spec.js index 350f42a187..b5fe8abbf0 100644 --- a/spec/integration/rest/api/v2010/account/signingKey.spec.js +++ b/spec/integration/rest/api/v2010/account/signingKey.spec.js @@ -31,7 +31,7 @@ describe('SigningKey', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,12 +54,12 @@ describe('SigningKey', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000' - }); + }; holodeck.mock(new Response(200, body)); @@ -75,7 +75,7 @@ describe('SigningKey', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -98,12 +98,12 @@ describe('SigningKey', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'foo', 'date_created': 'Mon, 13 Jun 2016 22:50:08 +0000', 'date_updated': 'Mon, 13 Jun 2016 22:50:08 +0000' - }); + }; holodeck.mock(new Response(200, body)); @@ -119,7 +119,7 @@ describe('SigningKey', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys('SKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -142,7 +142,7 @@ describe('SigningKey', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -158,7 +158,7 @@ describe('SigningKey', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'signing_keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -175,7 +175,7 @@ describe('SigningKey', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys.each(() => done()); @@ -183,7 +183,7 @@ describe('SigningKey', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'signing_keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -200,7 +200,7 @@ describe('SigningKey', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys.each({pageSize: 20}, () => done()); @@ -213,7 +213,7 @@ describe('SigningKey', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'signing_keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -230,7 +230,7 @@ describe('SigningKey', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys.each({callback: () => done()}, () => fail('wrong callback!')); @@ -238,7 +238,7 @@ describe('SigningKey', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .signingKeys.list(); @@ -260,7 +260,7 @@ describe('SigningKey', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'signing_keys': [ { 'sid': 'SKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -277,7 +277,7 @@ describe('SigningKey', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -293,7 +293,7 @@ describe('SigningKey', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'signing_keys': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SigningKeys.json?PageSize=50&Page=0', 'end': 0, @@ -303,7 +303,7 @@ describe('SigningKey', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js b/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js index dec17e6f9a..0b4b902e04 100644 --- a/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/credentialList.spec.js @@ -31,7 +31,7 @@ describe('CredentialList', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -51,7 +51,7 @@ describe('CredentialList', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -60,7 +60,7 @@ describe('CredentialList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -80,7 +80,7 @@ describe('CredentialList', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -94,7 +94,7 @@ describe('CredentialList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -114,7 +114,7 @@ describe('CredentialList', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -123,7 +123,7 @@ describe('CredentialList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -146,7 +146,7 @@ describe('CredentialList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -166,7 +166,7 @@ describe('CredentialList', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -183,7 +183,7 @@ describe('CredentialList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -191,7 +191,7 @@ describe('CredentialList', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -208,7 +208,7 @@ describe('CredentialList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -234,7 +234,7 @@ describe('CredentialList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 11 Sep 2013 17:51:38 -0000', 'date_updated': 'Wed, 11 Sep 2013 17:51:38 -0000', @@ -244,7 +244,7 @@ describe('CredentialList', function() { 'credentials': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -262,7 +262,7 @@ describe('CredentialList', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -286,7 +286,7 @@ describe('CredentialList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 11 Sep 2013 17:51:38 -0000', 'date_updated': 'Wed, 11 Sep 2013 17:51:38 -0000', @@ -296,7 +296,7 @@ describe('CredentialList', function() { 'credentials': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -313,7 +313,7 @@ describe('CredentialList', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -340,7 +340,7 @@ describe('CredentialList', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 11 Sep 2013 17:51:38 -0000', 'date_updated': 'Wed, 11 Sep 2013 17:51:38 -0000', @@ -350,7 +350,7 @@ describe('CredentialList', function() { 'credentials': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -368,7 +368,7 @@ describe('CredentialList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -392,7 +392,7 @@ describe('CredentialList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js b/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js index c1503b33f7..3f4864dd31 100644 --- a/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/credentialList/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -54,7 +54,7 @@ describe('Credential', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -64,7 +64,7 @@ describe('Credential', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -87,7 +87,7 @@ describe('Credential', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -102,7 +102,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -125,7 +125,7 @@ describe('Credential', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -135,7 +135,7 @@ describe('Credential', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -160,7 +160,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -183,7 +183,7 @@ describe('Credential', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -201,7 +201,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0', @@ -214,7 +214,7 @@ describe('Credential', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -232,7 +232,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {username: 'username', password: 'password'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -260,7 +260,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'credential_list_sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 19 Aug 2015 19:48:45 +0000', @@ -268,7 +268,7 @@ describe('Credential', function() { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'username': '1440013725.28' - }); + }; holodeck.mock(new Response(201, body)); @@ -287,7 +287,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -313,7 +313,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'credential_list_sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 19 Aug 2015 19:48:45 +0000', @@ -321,7 +321,7 @@ describe('Credential', function() { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'username': '1440013725.28' - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'credential_list_sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 19 Aug 2015 19:48:45 +0000', @@ -373,7 +373,7 @@ describe('Credential', function() { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json', 'username': '1440013725.28' - }); + }; holodeck.mock(new Response(200, body)); @@ -391,7 +391,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -417,7 +417,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain.spec.js b/spec/integration/rest/api/v2010/account/sip/domain.spec.js index c1c2f39d8c..3766ff756c 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain.spec.js @@ -31,7 +31,7 @@ describe('Domain', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'domains': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -65,7 +65,7 @@ describe('Domain', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -74,7 +74,7 @@ describe('Domain', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'domains': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('Domain', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -122,7 +122,7 @@ describe('Domain', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'domains': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -156,7 +156,7 @@ describe('Domain', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -165,7 +165,7 @@ describe('Domain', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -188,7 +188,7 @@ describe('Domain', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'domains': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -222,7 +222,7 @@ describe('Domain', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -239,7 +239,7 @@ describe('Domain', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'domains': [], 'start': 0, 'end': 0, @@ -249,7 +249,7 @@ describe('Domain', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -266,7 +266,7 @@ describe('Domain', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {domainName: 'domain_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -292,7 +292,7 @@ describe('Domain', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'auth_type': 'IP_ACL', @@ -314,7 +314,7 @@ describe('Domain', function() { 'voice_status_callback_url': null, 'voice_url': 'https://dundermifflin.example.com/twilio/app.php', 'trunk_sid': null - }); + }; holodeck.mock(new Response(201, body)); @@ -332,7 +332,7 @@ describe('Domain', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -356,7 +356,7 @@ describe('Domain', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'auth_type': 'IP_ACL', @@ -378,7 +378,7 @@ describe('Domain', function() { 'voice_status_callback_url': null, 'voice_url': 'https://dundermifflin.example.com/twilio/app.php', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -395,7 +395,7 @@ describe('Domain', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -419,7 +419,7 @@ describe('Domain', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'auth_type': 'IP_ACL', @@ -441,7 +441,7 @@ describe('Domain', function() { 'voice_status_callback_url': null, 'voice_url': 'https://dundermifflin.example.com/twilio/app.php', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -458,7 +458,7 @@ describe('Domain', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -482,7 +482,7 @@ describe('Domain', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.spec.js index bc62774d31..c9b311ea4c 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsCredentialListMapping.spec.js @@ -33,7 +33,7 @@ describe('AuthCallsCredentialListMapping', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {credentialListSid: 'CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -63,13 +63,13 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -90,7 +90,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -108,7 +108,7 @@ describe('AuthCallsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -120,7 +120,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -138,7 +138,7 @@ describe('AuthCallsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -155,7 +155,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -173,7 +173,7 @@ describe('AuthCallsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -185,7 +185,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -212,7 +212,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -222,7 +222,7 @@ describe('AuthCallsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -242,7 +242,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -260,7 +260,7 @@ describe('AuthCallsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -280,7 +280,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -308,13 +308,13 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -362,7 +362,7 @@ describe('AuthCallsCredentialListMapping', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.spec.js index b39c82f7ec..19dfb0c0a0 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authCallsMapping/authCallsIpAccessControlListMapping.spec.js @@ -33,7 +33,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ipAccessControlListSid: 'ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -63,13 +63,13 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -90,7 +90,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/IpAccessControlListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -108,7 +108,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -120,7 +120,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/IpAccessControlListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -138,7 +138,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -155,7 +155,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/IpAccessControlListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -173,7 +173,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -185,7 +185,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -212,7 +212,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/IpAccessControlListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -222,7 +222,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -242,7 +242,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Calls/IpAccessControlListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -260,7 +260,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -280,7 +280,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -308,13 +308,13 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -362,7 +362,7 @@ describe('AuthCallsIpAccessControlListMapping', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.spec.js index 843efc2139..fdf758d6e8 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/authTypes/authRegistrationsMapping/authRegistrationsCredentialListMapping.spec.js @@ -33,7 +33,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {credentialListSid: 'CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -63,13 +63,13 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -90,7 +90,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Registrations/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -108,7 +108,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -120,7 +120,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Registrations/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -138,7 +138,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -155,7 +155,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Registrations/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -173,7 +173,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -185,7 +185,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -212,7 +212,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Registrations/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -222,7 +222,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -242,7 +242,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Auth/Registrations/CredentialListMappings.json?PageSize=50&Page=0', 'end': 0, 'previous_page_uri': null, @@ -260,7 +260,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { 'start': 0, 'next_page_uri': null, 'page': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -280,7 +280,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -308,13 +308,13 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Thu, 30 Jul 2015 20:00:00 +0000', 'date_updated': 'Thu, 30 Jul 2015 20:00:00 +0000', 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -362,7 +362,7 @@ describe('AuthRegistrationsCredentialListMapping', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js index 2a9bfd8f97..1c68660656 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/credentialListMapping.spec.js @@ -31,7 +31,7 @@ describe('CredentialListMapping', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {credentialListSid: 'CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -59,7 +59,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 11 Sep 2013 17:51:38 -0000', 'date_updated': 'Wed, 11 Sep 2013 17:51:38 -0000', @@ -69,7 +69,7 @@ describe('CredentialListMapping', function() { 'credentials': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -88,7 +88,7 @@ describe('CredentialListMapping', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_list_mappings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('CredentialListMapping', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -118,7 +118,7 @@ describe('CredentialListMapping', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_list_mappings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -138,7 +138,7 @@ describe('CredentialListMapping', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -153,7 +153,7 @@ describe('CredentialListMapping', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credential_list_mappings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -173,7 +173,7 @@ describe('CredentialListMapping', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -183,7 +183,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -208,7 +208,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_list_mappings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -228,7 +228,7 @@ describe('CredentialListMapping', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -246,7 +246,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_list_mappings': [], 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0', 'next_page_uri': null, @@ -254,7 +254,7 @@ describe('CredentialListMapping', function() { 'page_size': 50, 'previous_page_uri': null, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialListMappings.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -272,7 +272,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -298,7 +298,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Wed, 11 Sep 2013 17:51:38 -0000', 'date_updated': 'Wed, 11 Sep 2013 17:51:38 -0000', @@ -308,7 +308,7 @@ describe('CredentialListMapping', function() { 'credentials': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Credentials.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -326,7 +326,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -352,7 +352,7 @@ describe('CredentialListMapping', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js b/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js index 497a668ef8..1a3d82e0dd 100644 --- a/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/domain/ipAccessControlListMapping.spec.js @@ -31,7 +31,7 @@ describe('IpAccessControlListMapping', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -57,7 +57,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 17 Jul 2015 21:25:15 +0000', 'date_updated': 'Fri, 17 Jul 2015 21:25:15 +0000', @@ -67,7 +67,7 @@ describe('IpAccessControlListMapping', function() { 'ip_addresses': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ipAccessControlListSid: 'ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -113,7 +113,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 17 Jul 2015 21:25:15 +0000', 'date_updated': 'Fri, 17 Jul 2015 21:25:15 +0000', @@ -123,7 +123,7 @@ describe('IpAccessControlListMapping', function() { 'ip_addresses': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -142,7 +142,7 @@ describe('IpAccessControlListMapping', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'ip_access_control_list_mappings': [ @@ -167,7 +167,7 @@ describe('IpAccessControlListMapping', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -177,7 +177,7 @@ describe('IpAccessControlListMapping', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'ip_access_control_list_mappings': [ @@ -202,7 +202,7 @@ describe('IpAccessControlListMapping', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -217,7 +217,7 @@ describe('IpAccessControlListMapping', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'ip_access_control_list_mappings': [ @@ -242,7 +242,7 @@ describe('IpAccessControlListMapping', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -252,7 +252,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -277,7 +277,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'ip_access_control_list_mappings': [ @@ -302,7 +302,7 @@ describe('IpAccessControlListMapping', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -320,7 +320,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json?SipDomainSid=SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'ip_access_control_list_mappings': [], @@ -333,7 +333,7 @@ describe('IpAccessControlListMapping', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlListMappings.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -351,7 +351,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -377,7 +377,7 @@ describe('IpAccessControlListMapping', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js index b12b4d63fd..c83fcfc076 100644 --- a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList.spec.js @@ -31,7 +31,7 @@ describe('IpAccessControlList', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0', 'ip_access_control_lists': [ @@ -56,7 +56,7 @@ describe('IpAccessControlList', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -65,7 +65,7 @@ describe('IpAccessControlList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0', 'ip_access_control_lists': [ @@ -90,7 +90,7 @@ describe('IpAccessControlList', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -104,7 +104,7 @@ describe('IpAccessControlList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0', 'ip_access_control_lists': [ @@ -129,7 +129,7 @@ describe('IpAccessControlList', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -138,7 +138,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -161,7 +161,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0', 'ip_access_control_lists': [ @@ -186,7 +186,7 @@ describe('IpAccessControlList', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -203,7 +203,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0', 'ip_access_control_lists': [], @@ -216,7 +216,7 @@ describe('IpAccessControlList', function() { 'start': 0, 'total': 1, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -233,7 +233,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -259,7 +259,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 17 Jul 2015 21:25:15 +0000', 'date_updated': 'Fri, 17 Jul 2015 21:25:15 +0000', @@ -269,7 +269,7 @@ describe('IpAccessControlList', function() { 'ip_addresses': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -287,7 +287,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -311,7 +311,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 17 Jul 2015 21:25:15 +0000', 'date_updated': 'Fri, 17 Jul 2015 21:25:15 +0000', @@ -321,7 +321,7 @@ describe('IpAccessControlList', function() { 'ip_addresses': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -338,7 +338,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -365,7 +365,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 17 Jul 2015 21:25:15 +0000', 'date_updated': 'Fri, 17 Jul 2015 21:25:15 +0000', @@ -375,7 +375,7 @@ describe('IpAccessControlList', function() { 'ip_addresses': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json' }, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -417,7 +417,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js index 8a739db1fe..b271cd53dc 100644 --- a/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js +++ b/spec/integration/rest/api/v2010/account/sip/ipAccessControlList/ipAddress.spec.js @@ -31,7 +31,7 @@ describe('IpAddress', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0', 'ip_addresses': [ @@ -53,7 +53,7 @@ describe('IpAddress', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -63,7 +63,7 @@ describe('IpAddress', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0', 'ip_addresses': [ @@ -85,7 +85,7 @@ describe('IpAddress', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -100,7 +100,7 @@ describe('IpAddress', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0', 'ip_addresses': [ @@ -122,7 +122,7 @@ describe('IpAddress', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -132,7 +132,7 @@ describe('IpAddress', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -157,7 +157,7 @@ describe('IpAddress', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0', 'ip_addresses': [ @@ -179,7 +179,7 @@ describe('IpAddress', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -197,7 +197,7 @@ describe('IpAddress', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0', 'ip_addresses': [], @@ -207,7 +207,7 @@ describe('IpAddress', function() { 'previous_page_uri': null, 'start': 0, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses.json?PageSize=50&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -225,7 +225,7 @@ describe('IpAddress', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', ipAddress: 'ip_address'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -253,7 +253,7 @@ describe('IpAddress', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Mon, 20 Jul 2015 17:27:10 +0000', 'date_updated': 'Mon, 20 Jul 2015 17:27:10 +0000', @@ -263,7 +263,7 @@ describe('IpAddress', function() { 'cidr_prefix_length': 32, 'sid': 'IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(201, body)); @@ -282,7 +282,7 @@ describe('IpAddress', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -308,7 +308,7 @@ describe('IpAddress', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Mon, 20 Jul 2015 17:27:10 +0000', 'date_updated': 'Mon, 20 Jul 2015 17:27:10 +0000', @@ -318,7 +318,7 @@ describe('IpAddress', function() { 'cidr_prefix_length': 32, 'sid': 'IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -336,7 +336,7 @@ describe('IpAddress', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -362,7 +362,7 @@ describe('IpAddress', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Mon, 20 Jul 2015 17:27:10 +0000', 'date_updated': 'Mon, 20 Jul 2015 17:27:10 +0000', @@ -372,7 +372,7 @@ describe('IpAddress', function() { 'cidr_prefix_length': 32, 'sid': 'IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAddresses/IPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -390,7 +390,7 @@ describe('IpAddress', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sip @@ -416,7 +416,7 @@ describe('IpAddress', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/api/v2010/account/token.spec.js b/spec/integration/rest/api/v2010/account/token.spec.js index 9f06c261ee..ecce319fa6 100644 --- a/spec/integration/rest/api/v2010/account/token.spec.js +++ b/spec/integration/rest/api/v2010/account/token.spec.js @@ -31,7 +31,7 @@ describe('Token', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tokens.create(); @@ -53,7 +53,7 @@ describe('Token', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': 'Fri, 24 Jul 2015 18:43:58 +0000', 'date_updated': 'Fri, 24 Jul 2015 18:43:58 +0000', @@ -72,7 +72,7 @@ describe('Token', function() { 'password': '5SR2x8mZK1lTFJW3NVgLGw6UM9C0dja4jI/Hdw3xr+w=', 'ttl': '86400', 'username': 'cda92e5006c7810494639fc466ecc80182cef8183fdf400f84c4126f3b59d0bb' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/api/v2010/account/transcription.spec.js b/spec/integration/rest/api/v2010/account/transcription.spec.js index 0c38e4fe81..834fa6e8e4 100644 --- a/spec/integration/rest/api/v2010/account/transcription.spec.js +++ b/spec/integration/rest/api/v2010/account/transcription.spec.js @@ -31,7 +31,7 @@ describe('Transcription', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Transcription', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2008-08-01', 'date_created': 'Sun, 13 Feb 2011 02:12:08 +0000', @@ -68,7 +68,7 @@ describe('Transcription', function() { 'transcription_text': '(blank)', 'type': 'fast', 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Transcription', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -107,7 +107,7 @@ describe('Transcription', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -123,7 +123,7 @@ describe('Transcription', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3', @@ -152,7 +152,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions.each(() => done()); @@ -160,7 +160,7 @@ describe('Transcription', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3', @@ -189,7 +189,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions.each({pageSize: 20}, () => done()); @@ -202,7 +202,7 @@ describe('Transcription', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3', @@ -231,7 +231,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions.each({callback: () => done()}, () => fail('wrong callback!')); @@ -239,7 +239,7 @@ describe('Transcription', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .transcriptions.list(); @@ -261,7 +261,7 @@ describe('Transcription', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3', @@ -290,7 +290,7 @@ describe('Transcription', function() { } ], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); @@ -306,7 +306,7 @@ describe('Transcription', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=3', @@ -319,7 +319,7 @@ describe('Transcription', function() { 'total': 4, 'transcriptions': [], 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Transcriptions.json?PageSize=1&Page=0' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record.spec.js b/spec/integration/rest/api/v2010/account/usage/record.spec.js index ea409d78c7..004330a4eb 100644 --- a/spec/integration/rest/api/v2010/account/usage/record.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record.spec.js @@ -31,7 +31,7 @@ describe('Record', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('Record', function() { 'usage_unit': 'usd' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -80,7 +80,7 @@ describe('Record', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1', @@ -120,7 +120,7 @@ describe('Record', function() { 'usage_unit': 'usd' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -134,7 +134,7 @@ describe('Record', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1', @@ -174,7 +174,7 @@ describe('Record', function() { 'usage_unit': 'usd' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -183,7 +183,7 @@ describe('Record', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -206,7 +206,7 @@ describe('Record', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1', @@ -246,7 +246,7 @@ describe('Record', function() { 'usage_unit': 'usd' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -263,7 +263,7 @@ describe('Record', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Page=68&PageSize=1', @@ -276,7 +276,7 @@ describe('Record', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js b/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js index 1adca6dff3..91d058bf98 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/allTime.spec.js @@ -31,7 +31,7 @@ describe('AllTime', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('AllTime', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('AllTime', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1', @@ -121,7 +121,7 @@ describe('AllTime', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('AllTime', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1', @@ -176,7 +176,7 @@ describe('AllTime', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('AllTime', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('AllTime', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1', @@ -250,7 +250,7 @@ describe('AllTime', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('AllTime', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime?Page=68&PageSize=1', @@ -281,7 +281,7 @@ describe('AllTime', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/AllTime', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js b/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js index 4df9847890..dfe6c9e8c6 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/daily.spec.js @@ -31,7 +31,7 @@ describe('Daily', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1', @@ -71,7 +71,7 @@ describe('Daily', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('Daily', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1', @@ -121,7 +121,7 @@ describe('Daily', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('Daily', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1', @@ -176,7 +176,7 @@ describe('Daily', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('Daily', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('Daily', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1', @@ -250,7 +250,7 @@ describe('Daily', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('Daily', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily?Page=101843&PageSize=1', @@ -281,7 +281,7 @@ describe('Daily', function() { 'total': 101844, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Daily', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js b/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js index 54b60d1fba..dbf3af3dbf 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/lastMonth.spec.js @@ -31,7 +31,7 @@ describe('LastMonth', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('LastMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('LastMonth', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1', @@ -121,7 +121,7 @@ describe('LastMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('LastMonth', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1', @@ -176,7 +176,7 @@ describe('LastMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('LastMonth', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('LastMonth', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1', @@ -250,7 +250,7 @@ describe('LastMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('LastMonth', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth?Page=68&PageSize=1', @@ -281,7 +281,7 @@ describe('LastMonth', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/LastMonth', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js b/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js index c611c5773f..57d50dc098 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/monthly.spec.js @@ -31,7 +31,7 @@ describe('Monthly', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1', @@ -71,7 +71,7 @@ describe('Monthly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('Monthly', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1', @@ -121,7 +121,7 @@ describe('Monthly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('Monthly', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1', @@ -176,7 +176,7 @@ describe('Monthly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('Monthly', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('Monthly', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1', @@ -250,7 +250,7 @@ describe('Monthly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('Monthly', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly?Page=3449&PageSize=1', @@ -281,7 +281,7 @@ describe('Monthly', function() { 'total': 3450, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Monthly', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js b/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js index 9d3d09e36f..69c34c9e5c 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/thisMonth.spec.js @@ -31,7 +31,7 @@ describe('ThisMonth', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('ThisMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('ThisMonth', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1', @@ -121,7 +121,7 @@ describe('ThisMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('ThisMonth', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1', @@ -176,7 +176,7 @@ describe('ThisMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('ThisMonth', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('ThisMonth', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1', @@ -250,7 +250,7 @@ describe('ThisMonth', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('ThisMonth', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth?Page=68&PageSize=1', @@ -281,7 +281,7 @@ describe('ThisMonth', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/ThisMonth', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/today.spec.js b/spec/integration/rest/api/v2010/account/usage/record/today.spec.js index 233129ae87..c5ebb9c88d 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/today.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/today.spec.js @@ -31,7 +31,7 @@ describe('Today', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('Today', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('Today', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1', @@ -121,7 +121,7 @@ describe('Today', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('Today', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1', @@ -176,7 +176,7 @@ describe('Today', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('Today', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('Today', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1', @@ -250,7 +250,7 @@ describe('Today', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('Today', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today?Page=68&PageSize=1', @@ -281,7 +281,7 @@ describe('Today', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Today', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js b/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js index 899c21a1e7..aba90586c2 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/yearly.spec.js @@ -31,7 +31,7 @@ describe('Yearly', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1', @@ -71,7 +71,7 @@ describe('Yearly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('Yearly', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1', @@ -121,7 +121,7 @@ describe('Yearly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('Yearly', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1', @@ -176,7 +176,7 @@ describe('Yearly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('Yearly', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('Yearly', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1', @@ -250,7 +250,7 @@ describe('Yearly', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('Yearly', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly?Page=344&PageSize=1', @@ -281,7 +281,7 @@ describe('Yearly', function() { 'total': 345, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yearly', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js b/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js index 95a5c88fda..0ccd4cc6e6 100644 --- a/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/record/yesterday.spec.js @@ -31,7 +31,7 @@ describe('Yesterday', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1', @@ -71,7 +71,7 @@ describe('Yesterday', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -81,7 +81,7 @@ describe('Yesterday', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1', @@ -121,7 +121,7 @@ describe('Yesterday', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -136,7 +136,7 @@ describe('Yesterday', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1', @@ -176,7 +176,7 @@ describe('Yesterday', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -186,7 +186,7 @@ describe('Yesterday', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -210,7 +210,7 @@ describe('Yesterday', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1', @@ -250,7 +250,7 @@ describe('Yesterday', function() { 'usage_unit': 'messages' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -268,7 +268,7 @@ describe('Yesterday', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=0&PageSize=1', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday?Page=68&PageSize=1', @@ -281,7 +281,7 @@ describe('Yesterday', function() { 'total': 69, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records/Yesterday', 'usage_records': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/usage/trigger.spec.js b/spec/integration/rest/api/v2010/account/usage/trigger.spec.js index d4fecdb8c2..366ec815e2 100644 --- a/spec/integration/rest/api/v2010/account/usage/trigger.spec.js +++ b/spec/integration/rest/api/v2010/account/usage/trigger.spec.js @@ -31,7 +31,7 @@ describe('Trigger', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -55,7 +55,7 @@ describe('Trigger', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'callback_method': 'GET', @@ -72,7 +72,7 @@ describe('Trigger', function() { 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'usage_category': 'totalprice', 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' - }); + }; holodeck.mock(new Response(200, body)); @@ -89,7 +89,7 @@ describe('Trigger', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -113,7 +113,7 @@ describe('Trigger', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'callback_method': 'GET', @@ -130,7 +130,7 @@ describe('Trigger', function() { 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'usage_category': 'totalprice', 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' - }); + }; holodeck.mock(new Response(200, body)); @@ -147,7 +147,7 @@ describe('Trigger', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -171,7 +171,7 @@ describe('Trigger', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -188,7 +188,7 @@ describe('Trigger', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { callbackUrl: 'https://example.com', @@ -222,7 +222,7 @@ describe('Trigger', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'callback_method': 'GET', @@ -239,7 +239,7 @@ describe('Trigger', function() { 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers/UTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'usage_category': 'totalprice', 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' - }); + }; holodeck.mock(new Response(201, body)); @@ -261,7 +261,7 @@ describe('Trigger', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626', @@ -293,7 +293,7 @@ describe('Trigger', function() { 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -302,7 +302,7 @@ describe('Trigger', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626', @@ -334,7 +334,7 @@ describe('Trigger', function() { 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -348,7 +348,7 @@ describe('Trigger', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626', @@ -380,7 +380,7 @@ describe('Trigger', function() { 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' } ] - }); + }; holodeck.mock(new Response(200, body)); client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -389,7 +389,7 @@ describe('Trigger', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage @@ -412,7 +412,7 @@ describe('Trigger', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626', @@ -444,7 +444,7 @@ describe('Trigger', function() { 'usage_record_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Records?Category=totalprice' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -461,7 +461,7 @@ describe('Trigger', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end': 0, 'first_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=0', 'last_page_uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers?PageSize=1&Page=626', @@ -474,7 +474,7 @@ describe('Trigger', function() { 'total': 627, 'uri': '/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage/Triggers', 'usage_triggers': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/api/v2010/account/validationRequest.spec.js b/spec/integration/rest/api/v2010/account/validationRequest.spec.js index 10592a6a9d..c22664e0e9 100644 --- a/spec/integration/rest/api/v2010/account/validationRequest.spec.js +++ b/spec/integration/rest/api/v2010/account/validationRequest.spec.js @@ -31,7 +31,7 @@ describe('ValidationRequest', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumber: '+15017122661'}; var promise = client.api.v2010.accounts('ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,13 +56,13 @@ describe('ValidationRequest', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'phone_number': '+18001234567', 'validation_code': 100 - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/authy/v1/form.spec.js b/spec/integration/rest/authy/v1/form.spec.js index bb78802d0e..65ada59f79 100644 --- a/spec/integration/rest/authy/v1/form.spec.js +++ b/spec/integration/rest/authy/v1/form.spec.js @@ -31,7 +31,7 @@ describe('Form', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.authy.v1.forms('form-app-push').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Form', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'form_type': 'form-sms', 'forms': { 'create_factor': {}, @@ -61,7 +61,7 @@ describe('Form', function() { }, 'form_meta': {}, 'url': 'https://authy.twilio.com/v1/Forms/form-sms' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/authy/v1/service.spec.js b/spec/integration/rest/authy/v1/service.spec.js index e6edff0873..922d31b38f 100644 --- a/spec/integration/rest/authy/v1/service.spec.js +++ b/spec/integration/rest/authy/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services.create(opts); @@ -61,7 +61,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('Service', function() { 'links': { 'entities': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities' } - }); + }; holodeck.mock(new Response(201, body)); @@ -88,7 +88,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(opts); @@ -112,7 +112,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -127,7 +127,7 @@ describe('Service', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(opts); @@ -151,7 +151,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -162,7 +162,7 @@ describe('Service', function() { 'links': { 'entities': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities' } - }); + }; holodeck.mock(new Response(200, body)); @@ -177,7 +177,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'services': [ { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -201,14 +201,14 @@ describe('Service', function() { 'next_page_url': null, 'key': 'services' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'services': [ { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -232,7 +232,7 @@ describe('Service', function() { 'next_page_url': null, 'key': 'services' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -244,7 +244,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'services': [ { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -268,14 +268,14 @@ describe('Service', function() { 'next_page_url': null, 'key': 'services' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services.list(opts); @@ -298,7 +298,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'services': [], 'meta': { 'page': 0, @@ -309,7 +309,7 @@ describe('Service', function() { 'next_page_url': null, 'key': 'services' } - }); + }; holodeck.mock(new Response(200, body)); @@ -324,7 +324,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'services': [ { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -348,7 +348,7 @@ describe('Service', function() { 'next_page_url': null, 'key': 'services' } - }); + }; holodeck.mock(new Response(200, body)); @@ -363,7 +363,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); @@ -387,7 +387,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -398,7 +398,7 @@ describe('Service', function() { 'links': { 'entities': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/authy/v1/service/entity.spec.js b/spec/integration/rest/authy/v1/service/entity.spec.js index ad357972b9..820dcc9e6a 100644 --- a/spec/integration/rest/authy/v1/service/entity.spec.js +++ b/spec/integration/rest/authy/v1/service/entity.spec.js @@ -31,7 +31,7 @@ describe('Entity', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -63,7 +63,7 @@ describe('Entity', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'identity': 'ff483d1ff591898a9942916050d2ca3f', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -74,7 +74,7 @@ describe('Entity', function() { 'links': { 'factors': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors' } - }); + }; holodeck.mock(new Response(201, body)); @@ -91,7 +91,7 @@ describe('Entity', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Entity', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -133,7 +133,7 @@ describe('Entity', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('Entity', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'identity': 'ff483d1ff591898a9942916050d2ca3f', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -170,7 +170,7 @@ describe('Entity', function() { 'links': { 'factors': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors' } - }); + }; holodeck.mock(new Response(200, body)); @@ -186,7 +186,7 @@ describe('Entity', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'entities': [ { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -210,7 +210,7 @@ describe('Entity', function() { 'next_page_url': null, 'key': 'entities' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities.each(() => done()); @@ -218,7 +218,7 @@ describe('Entity', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'entities': [ { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -242,7 +242,7 @@ describe('Entity', function() { 'next_page_url': null, 'key': 'entities' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities.each({pageSize: 20}, () => done()); @@ -255,7 +255,7 @@ describe('Entity', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'entities': [ { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -279,7 +279,7 @@ describe('Entity', function() { 'next_page_url': null, 'key': 'entities' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities.each({callback: () => done()}, () => fail('wrong callback!')); @@ -287,7 +287,7 @@ describe('Entity', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -312,7 +312,7 @@ describe('Entity', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'entities': [], 'meta': { 'page': 0, @@ -323,7 +323,7 @@ describe('Entity', function() { 'next_page_url': null, 'key': 'entities' } - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('Entity', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'entities': [ { 'sid': 'YEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -363,7 +363,7 @@ describe('Entity', function() { 'next_page_url': null, 'key': 'entities' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/authy/v1/service/entity/factor.spec.js b/spec/integration/rest/authy/v1/service/entity/factor.spec.js index 3237d18176..a7897bf596 100644 --- a/spec/integration/rest/authy/v1/service/entity/factor.spec.js +++ b/spec/integration/rest/authy/v1/service/entity/factor.spec.js @@ -31,7 +31,7 @@ describe('Factor', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { binding: 'binding', @@ -70,7 +70,7 @@ describe('Factor', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -85,7 +85,7 @@ describe('Factor', function() { 'links': { 'challenges': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges' } - }); + }; holodeck.mock(new Response(201, body)); @@ -103,7 +103,7 @@ describe('Factor', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -131,7 +131,7 @@ describe('Factor', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -148,7 +148,7 @@ describe('Factor', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -176,7 +176,7 @@ describe('Factor', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -191,7 +191,7 @@ describe('Factor', function() { 'links': { 'challenges': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges' } - }); + }; holodeck.mock(new Response(200, body)); @@ -208,7 +208,7 @@ describe('Factor', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'factors': [ { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -236,7 +236,7 @@ describe('Factor', function() { 'next_page_url': null, 'key': 'factors' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities('identity') @@ -245,7 +245,7 @@ describe('Factor', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'factors': [ { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -273,7 +273,7 @@ describe('Factor', function() { 'next_page_url': null, 'key': 'factors' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities('identity') @@ -287,7 +287,7 @@ describe('Factor', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'factors': [ { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -315,7 +315,7 @@ describe('Factor', function() { 'next_page_url': null, 'key': 'factors' } - }); + }; holodeck.mock(new Response(200, body)); client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .entities('identity') @@ -324,7 +324,7 @@ describe('Factor', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -351,7 +351,7 @@ describe('Factor', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'factors': [], 'meta': { 'page': 0, @@ -362,7 +362,7 @@ describe('Factor', function() { 'next_page_url': null, 'key': 'factors' } - }); + }; holodeck.mock(new Response(200, body)); @@ -379,7 +379,7 @@ describe('Factor', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'factors': [ { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -407,7 +407,7 @@ describe('Factor', function() { 'next_page_url': null, 'key': 'factors' } - }); + }; holodeck.mock(new Response(200, body)); @@ -424,7 +424,7 @@ describe('Factor', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -452,7 +452,7 @@ describe('Factor', function() { ); it('should generate valid verify response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -467,7 +467,7 @@ describe('Factor', function() { 'links': { 'challenges': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/authy/v1/service/entity/factor/challenge.spec.js b/spec/integration/rest/authy/v1/service/entity/factor/challenge.spec.js index 3eed1324c7..f391bcd1c5 100644 --- a/spec/integration/rest/authy/v1/service/entity/factor/challenge.spec.js +++ b/spec/integration/rest/authy/v1/service/entity/factor/challenge.spec.js @@ -31,7 +31,7 @@ describe('Challenge', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -60,7 +60,7 @@ describe('Challenge', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -77,7 +77,7 @@ describe('Challenge', function() { 'hidden_details': 'Hidden details about the sign up', 'factor_type': 'sms', 'url': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -95,7 +95,7 @@ describe('Challenge', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -125,7 +125,7 @@ describe('Challenge', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -143,7 +143,7 @@ describe('Challenge', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -173,7 +173,7 @@ describe('Challenge', function() { ); it('should generate valid fetch_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -190,7 +190,7 @@ describe('Challenge', function() { 'hidden_details': 'hidden_details', 'factor_type': 'sms', 'url': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -208,7 +208,7 @@ describe('Challenge', function() { ); it('should generate valid fetch_latest response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -225,7 +225,7 @@ describe('Challenge', function() { 'hidden_details': 'hidden_details', 'factor_type': 'sms', 'url': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -243,7 +243,7 @@ describe('Challenge', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {twilioAuthySandboxMode: 'twilio_authy_sandbox_mode'}; var promise = client.authy.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -273,7 +273,7 @@ describe('Challenge', function() { ); it('should generate valid verify_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -290,7 +290,7 @@ describe('Challenge', function() { 'hidden_details': 'Hidden details about the sign up', 'factor_type': 'sms', 'url': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -308,7 +308,7 @@ describe('Challenge', function() { ); it('should generate valid verify_latest response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -325,7 +325,7 @@ describe('Challenge', function() { 'hidden_details': 'Hidden details about the sign up', 'factor_type': 'sms', 'url': 'https://authy.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Entities/ff483d1ff591898a9942916050d2ca3f/Factors/YFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Challenges/YCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant.spec.js b/spec/integration/rest/autopilot/v1/assistant.spec.js index d99a392ea6..ee619b2dcc 100644 --- a/spec/integration/rest/autopilot/v1/assistant.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant.spec.js @@ -31,7 +31,7 @@ describe('Assistant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Assistant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -77,7 +77,7 @@ describe('Assistant', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(200, body)); @@ -92,7 +92,7 @@ describe('Assistant', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -130,14 +130,14 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -175,7 +175,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -187,7 +187,7 @@ describe('Assistant', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -225,14 +225,14 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants.list(); promise.then(function() { @@ -252,7 +252,7 @@ describe('Assistant', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [], 'meta': { 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0', @@ -263,7 +263,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -278,7 +278,7 @@ describe('Assistant', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -316,7 +316,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -331,7 +331,7 @@ describe('Assistant', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants.create(); promise.then(function() { @@ -351,7 +351,7 @@ describe('Assistant', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -376,7 +376,7 @@ describe('Assistant', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(201, body)); @@ -391,7 +391,7 @@ describe('Assistant', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -412,7 +412,7 @@ describe('Assistant', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -437,7 +437,7 @@ describe('Assistant', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(200, body)); @@ -452,7 +452,7 @@ describe('Assistant', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -473,7 +473,7 @@ describe('Assistant', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/defaults.spec.js b/spec/integration/rest/autopilot/v1/assistant/defaults.spec.js index eb7a609c01..5e93ca7880 100644 --- a/spec/integration/rest/autopilot/v1/assistant/defaults.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/defaults.spec.js @@ -31,7 +31,7 @@ describe('Defaults', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .defaults().fetch(); @@ -53,12 +53,12 @@ describe('Defaults', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': {}, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults' - }); + }; holodeck.mock(new Response(200, body)); @@ -74,7 +74,7 @@ describe('Defaults', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .defaults().update(); @@ -96,12 +96,12 @@ describe('Defaults', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Defaults', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/dialogue.spec.js b/spec/integration/rest/autopilot/v1/assistant/dialogue.spec.js index 0499592afb..b1f01e35eb 100644 --- a/spec/integration/rest/autopilot/v1/assistant/dialogue.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/dialogue.spec.js @@ -31,7 +31,7 @@ describe('Dialogue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dialogues('UKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,13 +54,13 @@ describe('Dialogue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UKkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues/UKkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/exportAssistant.spec.js b/spec/integration/rest/autopilot/v1/assistant/exportAssistant.spec.js index 1bef8af0d5..0aeb0998a4 100644 --- a/spec/integration/rest/autopilot/v1/assistant/exportAssistant.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/exportAssistant.spec.js @@ -31,7 +31,7 @@ describe('ExportAssistant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .exportAssistant().fetch(); @@ -53,7 +53,7 @@ describe('ExportAssistant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Export', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -61,7 +61,7 @@ describe('ExportAssistant', function() { 'status': 'building', 'error_code': null, 'schema': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/fieldType.spec.js b/spec/integration/rest/autopilot/v1/assistant/fieldType.spec.js index efb82b82ed..63d1976086 100644 --- a/spec/integration/rest/autopilot/v1/assistant/fieldType.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/fieldType.spec.js @@ -31,7 +31,7 @@ describe('FieldType', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('FieldType', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -66,7 +66,7 @@ describe('FieldType', function() { 'field_values': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -82,7 +82,7 @@ describe('FieldType', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -107,7 +107,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each(() => done()); @@ -115,7 +115,7 @@ describe('FieldType', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -140,7 +140,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each({pageSize: 20}, () => done()); @@ -153,7 +153,7 @@ describe('FieldType', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -178,7 +178,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -186,7 +186,7 @@ describe('FieldType', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.list(); @@ -208,7 +208,7 @@ describe('FieldType', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -219,7 +219,7 @@ describe('FieldType', function() { 'key': 'field_types' }, 'field_types': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -235,7 +235,7 @@ describe('FieldType', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -260,7 +260,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('FieldType', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -301,7 +301,7 @@ describe('FieldType', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -313,7 +313,7 @@ describe('FieldType', function() { 'field_values': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -330,7 +330,7 @@ describe('FieldType', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -353,7 +353,7 @@ describe('FieldType', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -365,7 +365,7 @@ describe('FieldType', function() { 'field_values': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -381,7 +381,7 @@ describe('FieldType', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -404,7 +404,7 @@ describe('FieldType', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/fieldType/fieldValue.spec.js b/spec/integration/rest/autopilot/v1/assistant/fieldType/fieldValue.spec.js index 2b3c4ad76c..2ca4755540 100644 --- a/spec/integration/rest/autopilot/v1/assistant/fieldType/fieldValue.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/fieldType/fieldValue.spec.js @@ -31,7 +31,7 @@ describe('FieldValue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('FieldValue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type_sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('FieldValue', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'synonym_of': null - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('FieldValue', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('FieldValue', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -141,7 +141,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('FieldValue', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -188,7 +188,7 @@ describe('FieldValue', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -212,7 +212,7 @@ describe('FieldValue', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [], 'meta': { 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0', @@ -223,7 +223,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -240,7 +240,7 @@ describe('FieldValue', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -264,7 +264,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -281,7 +281,7 @@ describe('FieldValue', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', value: 'value'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -308,7 +308,7 @@ describe('FieldValue', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type_sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -319,7 +319,7 @@ describe('FieldValue', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'synonym_of': 'UCbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' - }); + }; holodeck.mock(new Response(201, body)); @@ -337,7 +337,7 @@ describe('FieldValue', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('FieldValue', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/modelBuild.spec.js b/spec/integration/rest/autopilot/v1/assistant/modelBuild.spec.js index c4bf28215c..e982659dbc 100644 --- a/spec/integration/rest/autopilot/v1/assistant/modelBuild.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/modelBuild.spec.js @@ -31,7 +31,7 @@ describe('ModelBuild', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('ModelBuild', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -65,7 +65,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': null, 'error_code': null - }); + }; holodeck.mock(new Response(200, body)); @@ -81,7 +81,7 @@ describe('ModelBuild', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -105,7 +105,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each(() => done()); @@ -113,7 +113,7 @@ describe('ModelBuild', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -137,7 +137,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each({pageSize: 20}, () => done()); @@ -150,7 +150,7 @@ describe('ModelBuild', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -174,7 +174,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each({callback: () => done()}, () => fail('wrong callback!')); @@ -182,7 +182,7 @@ describe('ModelBuild', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.list(); @@ -204,7 +204,7 @@ describe('ModelBuild', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -215,7 +215,7 @@ describe('ModelBuild', function() { 'page_size': 50 }, 'model_builds': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('ModelBuild', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -255,7 +255,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -271,7 +271,7 @@ describe('ModelBuild', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.create(); @@ -293,7 +293,7 @@ describe('ModelBuild', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -304,7 +304,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': null, 'error_code': null - }); + }; holodeck.mock(new Response(201, body)); @@ -320,7 +320,7 @@ describe('ModelBuild', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -343,7 +343,7 @@ describe('ModelBuild', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -354,7 +354,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': 100, 'error_code': null - }); + }; holodeck.mock(new Response(200, body)); @@ -370,7 +370,7 @@ describe('ModelBuild', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -393,7 +393,7 @@ describe('ModelBuild', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/query.spec.js b/spec/integration/rest/autopilot/v1/assistant/query.spec.js index d21febf4c8..17a881132d 100644 --- a/spec/integration/rest/autopilot/v1/assistant/query.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/query.spec.js @@ -31,7 +31,7 @@ describe('Query', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Query', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -78,7 +78,7 @@ describe('Query', function() { 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'voice', 'dialogue_sid': 'UKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -94,7 +94,7 @@ describe('Query', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -131,7 +131,7 @@ describe('Query', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each(() => done()); @@ -139,7 +139,7 @@ describe('Query', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -176,7 +176,7 @@ describe('Query', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each({pageSize: 20}, () => done()); @@ -189,7 +189,7 @@ describe('Query', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -226,7 +226,7 @@ describe('Query', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -234,7 +234,7 @@ describe('Query', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.list(); @@ -256,7 +256,7 @@ describe('Query', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [], 'meta': { 'previous_page_url': null, @@ -267,7 +267,7 @@ describe('Query', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -283,7 +283,7 @@ describe('Query', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -320,7 +320,7 @@ describe('Query', function() { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -336,7 +336,7 @@ describe('Query', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', query: 'query'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -361,7 +361,7 @@ describe('Query', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -385,7 +385,7 @@ describe('Query', function() { 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'voice', 'dialogue_sid': null - }); + }; holodeck.mock(new Response(201, body)); @@ -402,7 +402,7 @@ describe('Query', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -425,7 +425,7 @@ describe('Query', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -449,7 +449,7 @@ describe('Query', function() { 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'sms', 'dialogue_sid': 'UKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -465,7 +465,7 @@ describe('Query', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -488,7 +488,7 @@ describe('Query', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/styleSheet.spec.js b/spec/integration/rest/autopilot/v1/assistant/styleSheet.spec.js index 30b7d53b17..793136df27 100644 --- a/spec/integration/rest/autopilot/v1/assistant/styleSheet.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/styleSheet.spec.js @@ -31,7 +31,7 @@ describe('StyleSheet', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .styleSheet().fetch(); @@ -53,12 +53,12 @@ describe('StyleSheet', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': {}, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet' - }); + }; holodeck.mock(new Response(200, body)); @@ -74,7 +74,7 @@ describe('StyleSheet', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .styleSheet().update(); @@ -96,12 +96,12 @@ describe('StyleSheet', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/task.spec.js b/spec/integration/rest/autopilot/v1/assistant/task.spec.js index fe542f7b66..5469da15d2 100644 --- a/spec/integration/rest/autopilot/v1/assistant/task.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/task.spec.js @@ -31,7 +31,7 @@ describe('Task', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Task', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -70,7 +70,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Task', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -115,7 +115,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each(() => done()); @@ -123,7 +123,7 @@ describe('Task', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -152,7 +152,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({pageSize: 20}, () => done()); @@ -165,7 +165,7 @@ describe('Task', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -194,7 +194,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({callback: () => done()}, () => fail('wrong callback!')); @@ -202,7 +202,7 @@ describe('Task', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.list(); @@ -224,7 +224,7 @@ describe('Task', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -235,7 +235,7 @@ describe('Task', function() { 'previous_page_url': null }, 'tasks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -251,7 +251,7 @@ describe('Task', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -280,7 +280,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Task', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -321,7 +321,7 @@ describe('Task', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -337,7 +337,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(201, body)); @@ -354,7 +354,7 @@ describe('Task', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -377,7 +377,7 @@ describe('Task', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -393,7 +393,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(200, body)); @@ -409,7 +409,7 @@ describe('Task', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -432,7 +432,7 @@ describe('Task', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/task/field.spec.js b/spec/integration/rest/autopilot/v1/assistant/task/field.spec.js index c235bf6e28..19c7c68605 100644 --- a/spec/integration/rest/autopilot/v1/assistant/task/field.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/task/field.spec.js @@ -31,7 +31,7 @@ describe('Field', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Field', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', @@ -66,7 +66,7 @@ describe('Field', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type': 'field_type' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Field', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -106,7 +106,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -115,7 +115,7 @@ describe('Field', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -138,7 +138,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -152,7 +152,7 @@ describe('Field', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -175,7 +175,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -184,7 +184,7 @@ describe('Field', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -208,7 +208,7 @@ describe('Field', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [], 'meta': { 'page': 0, @@ -219,7 +219,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('Field', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -259,7 +259,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('Field', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {fieldType: 'field_type', uniqueName: 'unique_name'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -303,7 +303,7 @@ describe('Field', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', @@ -313,7 +313,7 @@ describe('Field', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type': 'field_type' - }); + }; holodeck.mock(new Response(201, body)); @@ -331,7 +331,7 @@ describe('Field', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -356,7 +356,7 @@ describe('Field', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/task/sample.spec.js b/spec/integration/rest/autopilot/v1/assistant/task/sample.spec.js index 62ac8652ab..d101cb5dbf 100644 --- a/spec/integration/rest/autopilot/v1/assistant/task/sample.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/task/sample.spec.js @@ -31,7 +31,7 @@ describe('Sample', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Sample', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': null - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Sample', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Sample', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -141,7 +141,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Sample', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -188,7 +188,7 @@ describe('Sample', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -212,7 +212,7 @@ describe('Sample', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [], 'meta': { 'first_page_url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?Language=language&PageSize=50&Page=0', @@ -223,7 +223,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -240,7 +240,7 @@ describe('Sample', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -264,7 +264,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -281,7 +281,7 @@ describe('Sample', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', taggedText: 'tagged_text'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -308,7 +308,7 @@ describe('Sample', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -319,7 +319,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': 'alexa' - }); + }; holodeck.mock(new Response(201, body)); @@ -337,7 +337,7 @@ describe('Sample', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Sample', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -373,7 +373,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': 'alexa' - }); + }; holodeck.mock(new Response(200, body)); @@ -390,7 +390,7 @@ describe('Sample', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -415,7 +415,7 @@ describe('Sample', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/task/taskActions.spec.js b/spec/integration/rest/autopilot/v1/assistant/task/taskActions.spec.js index dd54742246..e062d2ed09 100644 --- a/spec/integration/rest/autopilot/v1/assistant/task/taskActions.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/task/taskActions.spec.js @@ -31,7 +31,7 @@ describe('TaskActions', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,13 +55,13 @@ describe('TaskActions', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDdddddddddddddddddddddddddddddddd', 'data': {}, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDdddddddddddddddddddddddddddddddd/Actions' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('TaskActions', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -102,13 +102,13 @@ describe('TaskActions', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDdddddddddddddddddddddddddddddddd', 'data': {}, 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDdddddddddddddddddddddddddddddddd/Actions' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/task/taskStatistics.spec.js b/spec/integration/rest/autopilot/v1/assistant/task/taskStatistics.spec.js index fc095000f1..a11dd20862 100644 --- a/spec/integration/rest/autopilot/v1/assistant/task/taskStatistics.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/task/taskStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,14 +55,14 @@ describe('TaskStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'samples_count': 0, 'fields_count': 0 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/autopilot/v1/assistant/webhook.spec.js b/spec/integration/rest/autopilot/v1/assistant/webhook.spec.js index 85c77079bb..cae236d126 100644 --- a/spec/integration/rest/autopilot/v1/assistant/webhook.spec.js +++ b/spec/integration/rest/autopilot/v1/assistant/webhook.spec.js @@ -31,7 +31,7 @@ describe('Webhook', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('UMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Webhook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -65,7 +65,7 @@ describe('Webhook', function() { 'events': 'ondialogueend', 'webhook_url': 'https://example.com/url', 'webhook_method': 'POST' - }); + }; holodeck.mock(new Response(200, body)); @@ -81,7 +81,7 @@ describe('Webhook', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'webhooks', 'page_size': 50, @@ -105,7 +105,7 @@ describe('Webhook', function() { 'webhook_method': 'POST' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each(() => done()); @@ -113,7 +113,7 @@ describe('Webhook', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'webhooks', 'page_size': 50, @@ -137,7 +137,7 @@ describe('Webhook', function() { 'webhook_method': 'POST' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each({pageSize: 20}, () => done()); @@ -150,7 +150,7 @@ describe('Webhook', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'webhooks', 'page_size': 50, @@ -174,7 +174,7 @@ describe('Webhook', function() { 'webhook_method': 'POST' } ] - }); + }; holodeck.mock(new Response(200, body)); client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each({callback: () => done()}, () => fail('wrong callback!')); @@ -182,7 +182,7 @@ describe('Webhook', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.list(); @@ -204,7 +204,7 @@ describe('Webhook', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'webhooks', 'page_size': 50, @@ -215,7 +215,7 @@ describe('Webhook', function() { 'previous_page_url': null }, 'webhooks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('Webhook', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'webhooks', 'page_size': 50, @@ -255,7 +255,7 @@ describe('Webhook', function() { 'webhook_method': 'POST' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -271,7 +271,7 @@ describe('Webhook', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name', events: 'events', webhookUrl: 'https://example.com'}; var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -296,7 +296,7 @@ describe('Webhook', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -307,7 +307,7 @@ describe('Webhook', function() { 'events': 'ondialogueend', 'webhook_url': 'https://example.com/url', 'webhook_method': 'POST' - }); + }; holodeck.mock(new Response(201, body)); @@ -324,7 +324,7 @@ describe('Webhook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('UMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -347,7 +347,7 @@ describe('Webhook', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://autopilot.twilio.com/v1/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -358,7 +358,7 @@ describe('Webhook', function() { 'events': 'ondialogueend', 'webhook_url': 'https://example.com/url', 'webhook_method': 'POST' - }); + }; holodeck.mock(new Response(200, body)); @@ -374,7 +374,7 @@ describe('Webhook', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.autopilot.v1.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('UMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -397,7 +397,7 @@ describe('Webhook', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v1/credential.spec.js b/spec/integration/rest/chat/v1/credential.spec.js index 168940f8cb..8f026c41e5 100644 --- a/spec/integration/rest/chat/v1/credential.spec.js +++ b/spec/integration/rest/chat/v1/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -53,14 +53,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.credentials.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -82,7 +82,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.credentials.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.credentials.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.credentials.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'gcm'}; var promise = client.chat.v1.credentials.create(opts); @@ -229,7 +229,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -238,7 +238,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -254,7 +254,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -275,7 +275,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -284,7 +284,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -320,7 +320,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -329,7 +329,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -344,7 +344,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v1/service.spec.js b/spec/integration/rest/chat/v1/service.spec.js index da455416e0..ce3998a74a 100644 --- a/spec/integration/rest/chat/v1/service.spec.js +++ b/spec/integration/rest/chat/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -80,7 +80,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(200, body)); @@ -95,7 +95,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -116,7 +116,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -131,7 +131,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.chat.v1.services.create(opts); @@ -154,7 +154,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -182,7 +182,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(201, body)); @@ -198,7 +198,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -239,14 +239,14 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -287,7 +287,7 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -299,7 +299,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -340,14 +340,14 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services.list(); promise.then(function() { @@ -367,7 +367,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -378,7 +378,7 @@ describe('Service', function() { 'url': 'https://chat.twilio.com/v1/Services' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -434,7 +434,7 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -449,7 +449,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -470,7 +470,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -498,7 +498,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/channel.spec.js b/spec/integration/rest/chat/v1/service/channel.spec.js index b8509fd417..f75b51658f 100644 --- a/spec/integration/rest/chat/v1/service/channel.spec.js +++ b/spec/integration/rest/chat/v1/service/channel.spec.js @@ -31,7 +31,7 @@ describe('Channel', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Channel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -74,7 +74,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Channel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -113,7 +113,7 @@ describe('Channel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Channel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.create(); @@ -151,7 +151,7 @@ describe('Channel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -171,7 +171,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Channel', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -220,7 +220,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each(() => done()); @@ -228,7 +228,7 @@ describe('Channel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -261,7 +261,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({pageSize: 20}, () => done()); @@ -274,7 +274,7 @@ describe('Channel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -307,7 +307,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({callback: () => done()}, () => fail('wrong callback!')); @@ -315,7 +315,7 @@ describe('Channel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.list(); @@ -337,7 +337,7 @@ describe('Channel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -370,7 +370,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -386,7 +386,7 @@ describe('Channel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [], 'meta': { 'page': 0, @@ -397,7 +397,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -413,7 +413,7 @@ describe('Channel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -436,7 +436,7 @@ describe('Channel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -456,7 +456,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/channel/invite.spec.js b/spec/integration/rest/chat/v1/service/channel/invite.spec.js index 2ecfb565e5..858a2a75db 100644 --- a/spec/integration/rest/chat/v1/service/channel/invite.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/invite.spec.js @@ -31,7 +31,7 @@ describe('Invite', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Invite', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -67,7 +67,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Invite', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Invite', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -122,7 +122,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -140,7 +140,7 @@ describe('Invite', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -164,7 +164,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -173,7 +173,7 @@ describe('Invite', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -197,7 +197,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -211,7 +211,7 @@ describe('Invite', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -235,7 +235,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -244,7 +244,7 @@ describe('Invite', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -268,7 +268,7 @@ describe('Invite', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [], 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0', @@ -279,7 +279,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Invite', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -320,7 +320,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Invite', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Invite', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v1/service/channel/member.spec.js b/spec/integration/rest/chat/v1/service/channel/member.spec.js index 52321a02f5..e85c1f1116 100644 --- a/spec/integration/rest/chat/v1/service/channel/member.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/member.spec.js @@ -31,7 +31,7 @@ describe('Member', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Member', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('Member', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Member', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -124,7 +124,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -142,7 +142,7 @@ describe('Member', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -167,7 +167,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -176,7 +176,7 @@ describe('Member', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -201,7 +201,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -215,7 +215,7 @@ describe('Member', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -240,7 +240,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -249,7 +249,7 @@ describe('Member', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -273,7 +273,7 @@ describe('Member', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -298,7 +298,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('Member', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -326,7 +326,7 @@ describe('Member', function() { 'key': 'members' }, 'members': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('Member', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -368,7 +368,7 @@ describe('Member', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -385,7 +385,7 @@ describe('Member', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -410,7 +410,7 @@ describe('Member', function() { ); it('should generate valid update_role_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -422,7 +422,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -439,7 +439,7 @@ describe('Member', function() { ); it('should generate valid update_last_consumed_message_index response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -451,7 +451,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/channel/message.spec.js b/spec/integration/rest/chat/v1/service/channel/message.spec.js index 3e566adac0..4486d4f314 100644 --- a/spec/integration/rest/chat/v1/service/channel/message.spec.js +++ b/spec/integration/rest/chat/v1/service/channel/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -70,7 +70,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Message', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {body: 'body'}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -114,7 +114,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -128,7 +128,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -146,7 +146,7 @@ describe('Message', function() { ); it('should generate valid create_with_attributes response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -160,7 +160,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -178,7 +178,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -205,7 +205,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -214,7 +214,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -241,7 +241,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -255,7 +255,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -282,7 +282,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -291,7 +291,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -315,7 +315,7 @@ describe('Message', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -342,7 +342,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -359,7 +359,7 @@ describe('Message', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -370,7 +370,7 @@ describe('Message', function() { 'key': 'messages' }, 'messages': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -387,7 +387,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -412,7 +412,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -429,7 +429,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -454,7 +454,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -468,7 +468,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/role.spec.js b/spec/integration/rest/chat/v1/service/role.spec.js index 12f61023fa..2c64ddc2a3 100644 --- a/spec/integration/rest/chat/v1/service/role.spec.js +++ b/spec/integration/rest/chat/v1/service/role.spec.js @@ -33,7 +33,7 @@ describe('Role', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('Role', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Role', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('Role', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('Role', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'channel', permission: ['permission']}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Role', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -170,7 +170,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Role', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each(() => done()); @@ -223,7 +223,7 @@ describe('Role', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -251,7 +251,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({pageSize: 20}, () => done()); @@ -264,7 +264,7 @@ describe('Role', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -292,7 +292,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({callback: () => done()}, () => fail('wrong callback!')); @@ -300,7 +300,7 @@ describe('Role', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.list(); @@ -322,7 +322,7 @@ describe('Role', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -350,7 +350,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -366,7 +366,7 @@ describe('Role', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -377,7 +377,7 @@ describe('Role', function() { 'key': 'roles' }, 'roles': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Role', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {permission: ['permission']}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('Role', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -434,7 +434,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/user.spec.js b/spec/integration/rest/chat/v1/service/user.spec.js index b0d93e4b05..3576faf78d 100644 --- a/spec/integration/rest/chat/v1/service/user.spec.js +++ b/spec/integration/rest/chat/v1/service/user.spec.js @@ -31,7 +31,7 @@ describe('User', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('User', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('User', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('User', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('User', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -151,7 +151,7 @@ describe('User', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -168,7 +168,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -185,7 +185,7 @@ describe('User', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each(() => done()); @@ -223,7 +223,7 @@ describe('User', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -253,7 +253,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({pageSize: 20}, () => done()); @@ -266,7 +266,7 @@ describe('User', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -296,7 +296,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({callback: () => done()}, () => fail('wrong callback!')); @@ -304,7 +304,7 @@ describe('User', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.list(); @@ -326,7 +326,7 @@ describe('User', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -356,7 +356,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -372,7 +372,7 @@ describe('User', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -383,7 +383,7 @@ describe('User', function() { 'key': 'users' }, 'users': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -399,7 +399,7 @@ describe('User', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -422,7 +422,7 @@ describe('User', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -439,7 +439,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v1/service/user/userChannel.spec.js b/spec/integration/rest/chat/v1/service/user/userChannel.spec.js index 9710121925..7fb409b9dc 100644 --- a/spec/integration/rest/chat/v1/service/user/userChannel.spec.js +++ b/spec/integration/rest/chat/v1/service/user/userChannel.spec.js @@ -31,7 +31,7 @@ describe('UserChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -56,7 +56,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -65,7 +65,7 @@ describe('UserChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -90,7 +90,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -104,7 +104,7 @@ describe('UserChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -129,7 +129,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -138,7 +138,7 @@ describe('UserChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -162,7 +162,7 @@ describe('UserChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -187,7 +187,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -204,7 +204,7 @@ describe('UserChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('UserChannel', function() { 'key': 'channels' }, 'channels': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/credential.spec.js b/spec/integration/rest/chat/v2/credential.spec.js index 8710f12217..d9e808623f 100644 --- a/spec/integration/rest/chat/v2/credential.spec.js +++ b/spec/integration/rest/chat/v2/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -53,14 +53,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.credentials.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -82,7 +82,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.credentials.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.credentials.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.credentials.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'gcm'}; var promise = client.chat.v2.credentials.create(opts); @@ -229,7 +229,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -238,7 +238,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -254,7 +254,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -275,7 +275,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -284,7 +284,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -320,7 +320,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -329,7 +329,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -344,7 +344,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v2/service.spec.js b/spec/integration/rest/chat/v2/service.spec.js index 771716db08..95e3b25996 100644 --- a/spec/integration/rest/chat/v2/service.spec.js +++ b/spec/integration/rest/chat/v2/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -89,7 +89,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'media compatibility message' } - }); + }; holodeck.mock(new Response(200, body)); @@ -104,7 +104,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -125,7 +125,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -140,7 +140,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.chat.v2.services.create(opts); @@ -163,7 +163,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -200,7 +200,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'media compatibility message' } - }); + }; holodeck.mock(new Response(201, body)); @@ -216,7 +216,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -266,14 +266,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -323,7 +323,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -335,7 +335,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -385,14 +385,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services.list(); promise.then(function() { @@ -412,7 +412,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -423,7 +423,7 @@ describe('Service', function() { 'url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -438,7 +438,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -488,7 +488,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -503,7 +503,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -524,7 +524,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -580,7 +580,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'new media compatibility message' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/binding.spec.js b/spec/integration/rest/chat/v2/service/binding.spec.js index 1a05664d5f..a89b9c96ae 100644 --- a/spec/integration/rest/chat/v2/service/binding.spec.js +++ b/spec/integration/rest/chat/v2/service/binding.spec.js @@ -31,7 +31,7 @@ describe('Binding', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -64,7 +64,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each(() => done()); @@ -72,7 +72,7 @@ describe('Binding', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -105,7 +105,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({pageSize: 20}, () => done()); @@ -118,7 +118,7 @@ describe('Binding', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -151,7 +151,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({callback: () => done()}, () => fail('wrong callback!')); @@ -159,7 +159,7 @@ describe('Binding', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.list(); @@ -181,7 +181,7 @@ describe('Binding', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -214,7 +214,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -230,7 +230,7 @@ describe('Binding', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -241,7 +241,7 @@ describe('Binding', function() { 'key': 'bindings' }, 'bindings': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -257,7 +257,7 @@ describe('Binding', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -280,7 +280,7 @@ describe('Binding', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -300,7 +300,7 @@ describe('Binding', function() { 'links': { 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' } - }); + }; holodeck.mock(new Response(200, body)); @@ -316,7 +316,7 @@ describe('Binding', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -339,7 +339,7 @@ describe('Binding', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v2/service/channel.spec.js b/spec/integration/rest/chat/v2/service/channel.spec.js index 7dfbd19e79..00d4840643 100644 --- a/spec/integration/rest/chat/v2/service/channel.spec.js +++ b/spec/integration/rest/chat/v2/service/channel.spec.js @@ -31,7 +31,7 @@ describe('Channel', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Channel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -75,7 +75,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('Channel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Channel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -133,7 +133,7 @@ describe('Channel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -158,7 +158,7 @@ describe('Channel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(201, body)); @@ -195,7 +195,7 @@ describe('Channel', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -229,7 +229,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each(() => done()); @@ -237,7 +237,7 @@ describe('Channel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -271,7 +271,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({pageSize: 20}, () => done()); @@ -284,7 +284,7 @@ describe('Channel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -318,7 +318,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({callback: () => done()}, () => fail('wrong callback!')); @@ -326,7 +326,7 @@ describe('Channel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.list(); @@ -348,7 +348,7 @@ describe('Channel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -382,7 +382,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -398,7 +398,7 @@ describe('Channel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [], 'meta': { 'page': 0, @@ -409,7 +409,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -425,7 +425,7 @@ describe('Channel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -451,7 +451,7 @@ describe('Channel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -472,7 +472,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/channel/invite.spec.js b/spec/integration/rest/chat/v2/service/channel/invite.spec.js index 3ad123c5c0..706aab3ba5 100644 --- a/spec/integration/rest/chat/v2/service/channel/invite.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/invite.spec.js @@ -31,7 +31,7 @@ describe('Invite', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Invite', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -67,7 +67,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Invite', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Invite', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -122,7 +122,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -140,7 +140,7 @@ describe('Invite', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -164,7 +164,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -173,7 +173,7 @@ describe('Invite', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -197,7 +197,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -211,7 +211,7 @@ describe('Invite', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -235,7 +235,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -244,7 +244,7 @@ describe('Invite', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -268,7 +268,7 @@ describe('Invite', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [], 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0', @@ -279,7 +279,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Invite', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -320,7 +320,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Invite', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Invite', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v2/service/channel/member.spec.js b/spec/integration/rest/chat/v2/service/channel/member.spec.js index 22b74860f8..c85a93662d 100644 --- a/spec/integration/rest/chat/v2/service/channel/member.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/member.spec.js @@ -31,7 +31,7 @@ describe('Member', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Member', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:50Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Member', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -120,7 +120,7 @@ describe('Member', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -133,7 +133,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:50Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -151,7 +151,7 @@ describe('Member', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -177,7 +177,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -186,7 +186,7 @@ describe('Member', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -212,7 +212,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -226,7 +226,7 @@ describe('Member', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -252,7 +252,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -261,7 +261,7 @@ describe('Member', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -285,7 +285,7 @@ describe('Member', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -311,7 +311,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -328,7 +328,7 @@ describe('Member', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -339,7 +339,7 @@ describe('Member', function() { 'key': 'members' }, 'members': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -356,7 +356,7 @@ describe('Member', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -384,7 +384,7 @@ describe('Member', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -401,7 +401,7 @@ describe('Member', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -429,7 +429,7 @@ describe('Member', function() { ); it('should generate valid update_role_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -442,7 +442,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:51Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/channel/message.spec.js b/spec/integration/rest/chat/v2/service/channel/message.spec.js index ff52294a49..63f6be4078 100644 --- a/spec/integration/rest/chat/v2/service/channel/message.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -73,7 +73,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Message', function() { ); it('should generate valid fetch_media response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -112,7 +112,7 @@ describe('Message', function() { 'filename': 'hello.pdf' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -129,7 +129,7 @@ describe('Message', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -156,7 +156,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -173,7 +173,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -190,7 +190,7 @@ describe('Message', function() { ); it('should generate valid create_with_all response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -207,7 +207,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -224,7 +224,7 @@ describe('Message', function() { ); it('should generate valid create_media response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -246,7 +246,7 @@ describe('Message', function() { 'filename': 'hello.pdf' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -263,7 +263,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -316,7 +316,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -325,7 +325,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -378,7 +378,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -392,7 +392,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -445,7 +445,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -454,7 +454,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -478,7 +478,7 @@ describe('Message', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -531,7 +531,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -548,7 +548,7 @@ describe('Message', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -559,7 +559,7 @@ describe('Message', function() { 'key': 'messages' }, 'messages': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -576,7 +576,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -604,7 +604,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -621,7 +621,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -649,7 +649,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -666,7 +666,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/channel/webhook.spec.js b/spec/integration/rest/chat/v2/service/channel/webhook.spec.js index 87d0bd0acf..b5c2907c40 100644 --- a/spec/integration/rest/chat/v2/service/channel/webhook.spec.js +++ b/spec/integration/rest/chat/v2/service/channel/webhook.spec.js @@ -31,7 +31,7 @@ describe('Webhook', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -94,7 +94,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -103,7 +103,7 @@ describe('Webhook', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -166,7 +166,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -180,7 +180,7 @@ describe('Webhook', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -243,7 +243,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -252,7 +252,7 @@ describe('Webhook', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -276,7 +276,7 @@ describe('Webhook', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -339,7 +339,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -356,7 +356,7 @@ describe('Webhook', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -367,7 +367,7 @@ describe('Webhook', function() { 'key': 'webhooks' }, 'webhooks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -384,7 +384,7 @@ describe('Webhook', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -409,7 +409,7 @@ describe('Webhook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -421,7 +421,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -438,7 +438,7 @@ describe('Webhook', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'webhook'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -465,7 +465,7 @@ describe('Webhook', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -483,7 +483,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -501,7 +501,7 @@ describe('Webhook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -526,7 +526,7 @@ describe('Webhook', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -544,7 +544,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:51Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -561,7 +561,7 @@ describe('Webhook', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -586,7 +586,7 @@ describe('Webhook', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v2/service/role.spec.js b/spec/integration/rest/chat/v2/service/role.spec.js index 8e9d0c526e..23a83c6e14 100644 --- a/spec/integration/rest/chat/v2/service/role.spec.js +++ b/spec/integration/rest/chat/v2/service/role.spec.js @@ -33,7 +33,7 @@ describe('Role', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('Role', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Role', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('Role', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('Role', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'channel', permission: ['permission']}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Role', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -170,7 +170,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Role', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each(() => done()); @@ -223,7 +223,7 @@ describe('Role', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -251,7 +251,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({pageSize: 20}, () => done()); @@ -264,7 +264,7 @@ describe('Role', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -292,7 +292,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({callback: () => done()}, () => fail('wrong callback!')); @@ -300,7 +300,7 @@ describe('Role', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.list(); @@ -322,7 +322,7 @@ describe('Role', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -350,7 +350,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -366,7 +366,7 @@ describe('Role', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -377,7 +377,7 @@ describe('Role', function() { 'key': 'roles' }, 'roles': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Role', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {permission: ['permission']}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('Role', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -434,7 +434,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/user.spec.js b/spec/integration/rest/chat/v2/service/user.spec.js index ab9019e243..e1e24f1710 100644 --- a/spec/integration/rest/chat/v2/service/user.spec.js +++ b/spec/integration/rest/chat/v2/service/user.spec.js @@ -31,7 +31,7 @@ describe('User', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('User', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -88,7 +88,7 @@ describe('User', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -111,7 +111,7 @@ describe('User', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -127,7 +127,7 @@ describe('User', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('User', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -177,7 +177,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -194,7 +194,7 @@ describe('User', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -225,7 +225,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each(() => done()); @@ -233,7 +233,7 @@ describe('User', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -264,7 +264,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({pageSize: 20}, () => done()); @@ -277,7 +277,7 @@ describe('User', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -308,7 +308,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({callback: () => done()}, () => fail('wrong callback!')); @@ -316,7 +316,7 @@ describe('User', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.list(); @@ -338,7 +338,7 @@ describe('User', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -369,7 +369,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -385,7 +385,7 @@ describe('User', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -396,7 +396,7 @@ describe('User', function() { 'key': 'users' }, 'users': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -412,7 +412,7 @@ describe('User', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -438,7 +438,7 @@ describe('User', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -456,7 +456,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/chat/v2/service/user/userBinding.spec.js b/spec/integration/rest/chat/v2/service/user/userBinding.spec.js index e060825849..5b95ce17c8 100644 --- a/spec/integration/rest/chat/v2/service/user/userBinding.spec.js +++ b/spec/integration/rest/chat/v2/service/user/userBinding.spec.js @@ -31,7 +31,7 @@ describe('UserBinding', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -62,7 +62,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -71,7 +71,7 @@ describe('UserBinding', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -102,7 +102,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -116,7 +116,7 @@ describe('UserBinding', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -147,7 +147,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -156,7 +156,7 @@ describe('UserBinding', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -180,7 +180,7 @@ describe('UserBinding', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -211,7 +211,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -228,7 +228,7 @@ describe('UserBinding', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -239,7 +239,7 @@ describe('UserBinding', function() { 'key': 'bindings' }, 'bindings': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -256,7 +256,7 @@ describe('UserBinding', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -281,7 +281,7 @@ describe('UserBinding', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -299,7 +299,7 @@ describe('UserBinding', function() { 'invited_to_channel' ], 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -316,7 +316,7 @@ describe('UserBinding', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -341,7 +341,7 @@ describe('UserBinding', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/chat/v2/service/user/userChannel.spec.js b/spec/integration/rest/chat/v2/service/user/userChannel.spec.js index b3e218cf70..2b4f278762 100644 --- a/spec/integration/rest/chat/v2/service/user/userChannel.spec.js +++ b/spec/integration/rest/chat/v2/service/user/userChannel.spec.js @@ -31,7 +31,7 @@ describe('UserChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -59,7 +59,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -68,7 +68,7 @@ describe('UserChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -96,7 +96,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -110,7 +110,7 @@ describe('UserChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -138,7 +138,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -147,7 +147,7 @@ describe('UserChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -171,7 +171,7 @@ describe('UserChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -199,7 +199,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -216,7 +216,7 @@ describe('UserChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -227,7 +227,7 @@ describe('UserChannel', function() { 'key': 'channels' }, 'channels': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('UserChannel', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -269,7 +269,7 @@ describe('UserChannel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -284,7 +284,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('UserChannel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -326,7 +326,7 @@ describe('UserChannel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -343,7 +343,7 @@ describe('UserChannel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.chat.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -368,7 +368,7 @@ describe('UserChannel', function() { ); it('should generate valid update_notification_level response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -383,7 +383,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -400,7 +400,7 @@ describe('UserChannel', function() { ); it('should generate valid update_last_consumed_message_index response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -415,7 +415,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/conversations/v1/conversation.spec.js b/spec/integration/rest/conversations/v1/conversation.spec.js index 299ec2d996..16d22d78e6 100644 --- a/spec/integration/rest/conversations/v1/conversation.spec.js +++ b/spec/integration/rest/conversations/v1/conversation.spec.js @@ -31,7 +31,7 @@ describe('Conversation', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations.create(opts); @@ -54,7 +54,7 @@ describe('Conversation', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('Conversation', function() { 'messages': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'webhooks': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks' } - }); + }; holodeck.mock(new Response(201, body)); @@ -84,7 +84,7 @@ describe('Conversation', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); @@ -108,7 +108,7 @@ describe('Conversation', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -123,7 +123,7 @@ describe('Conversation', function() { 'messages': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'webhooks': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks' } - }); + }; holodeck.mock(new Response(200, body)); @@ -138,7 +138,7 @@ describe('Conversation', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(opts); @@ -162,7 +162,7 @@ describe('Conversation', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -177,7 +177,7 @@ describe('Conversation', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -198,7 +198,7 @@ describe('Conversation', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -213,7 +213,7 @@ describe('Conversation', function() { 'messages': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages', 'webhooks': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks' } - }); + }; holodeck.mock(new Response(200, body)); @@ -228,7 +228,7 @@ describe('Conversation', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'conversations': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -256,14 +256,14 @@ describe('Conversation', function() { 'next_page_url': null, 'key': 'conversations' } - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'conversations': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -291,7 +291,7 @@ describe('Conversation', function() { 'next_page_url': null, 'key': 'conversations' } - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -303,7 +303,7 @@ describe('Conversation', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'conversations': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -331,14 +331,14 @@ describe('Conversation', function() { 'next_page_url': null, 'key': 'conversations' } - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations.list(); promise.then(function() { @@ -358,7 +358,7 @@ describe('Conversation', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'conversations': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -386,7 +386,7 @@ describe('Conversation', function() { 'next_page_url': null, 'key': 'conversations' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/conversations/v1/conversation/message.spec.js b/spec/integration/rest/conversations/v1/conversation/message.spec.js index 3297ab395d..36790a44cd 100644 --- a/spec/integration/rest/conversations/v1/conversation/message.spec.js +++ b/spec/integration/rest/conversations/v1/conversation/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('Message', function() { 'date_updated': '2015-12-16T22:18:38Z', 'index': 0, 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -85,7 +85,7 @@ describe('Message', function() { ); it('should generate valid create_with_media response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -105,7 +105,7 @@ describe('Message', function() { 'date_updated': '2015-12-16T22:18:38Z', 'index': 0, 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -121,7 +121,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -147,7 +147,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -160,7 +160,7 @@ describe('Message', function() { 'date_updated': '2015-12-16T22:18:38Z', 'index': 0, 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -176,7 +176,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -202,7 +202,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -218,7 +218,7 @@ describe('Message', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages('IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -241,7 +241,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -254,7 +254,7 @@ describe('Message', function() { 'date_updated': '2016-03-24T20:37:57Z', 'index': 0, 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -270,7 +270,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -331,7 +331,7 @@ describe('Message', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each(() => done()); @@ -339,7 +339,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -400,7 +400,7 @@ describe('Message', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each({pageSize: 20}, () => done()); @@ -413,7 +413,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -474,7 +474,7 @@ describe('Message', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.each({callback: () => done()}, () => fail('wrong callback!')); @@ -482,7 +482,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messages.list(); @@ -504,7 +504,7 @@ describe('Message', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -565,7 +565,7 @@ describe('Message', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/conversations/v1/conversation/participant.spec.js b/spec/integration/rest/conversations/v1/conversation/participant.spec.js index fc9b5beaec..5a6ee569ec 100644 --- a/spec/integration/rest/conversations/v1/conversation/participant.spec.js +++ b/spec/integration/rest/conversations/v1/conversation/participant.spec.js @@ -31,7 +31,7 @@ describe('Participant', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Participant', function() { ); it('should generate valid create_sms response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -70,7 +70,7 @@ describe('Participant', function() { 'date_created': '2015-12-16T22:18:37Z', 'date_updated': '2015-12-16T22:18:38Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -86,7 +86,7 @@ describe('Participant', function() { ); it('should generate valid create_chat response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -96,7 +96,7 @@ describe('Participant', function() { 'date_created': '2015-12-16T22:18:37Z', 'date_updated': '2015-12-16T22:18:38Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -112,7 +112,7 @@ describe('Participant', function() { ); it('should generate valid create_gmms response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -125,7 +125,7 @@ describe('Participant', function() { 'date_created': '2015-12-16T22:18:37Z', 'date_updated': '2015-12-16T22:18:38Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -141,7 +141,7 @@ describe('Participant', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -167,7 +167,7 @@ describe('Participant', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -181,7 +181,7 @@ describe('Participant', function() { 'date_created': '2015-12-16T22:18:37Z', 'date_updated': '2015-12-16T22:18:38Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -197,7 +197,7 @@ describe('Participant', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -223,7 +223,7 @@ describe('Participant', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -239,7 +239,7 @@ describe('Participant', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('MBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -262,7 +262,7 @@ describe('Participant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -276,7 +276,7 @@ describe('Participant', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -292,7 +292,7 @@ describe('Participant', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -330,7 +330,7 @@ describe('Participant', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each(() => done()); @@ -338,7 +338,7 @@ describe('Participant', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -376,7 +376,7 @@ describe('Participant', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each({pageSize: 20}, () => done()); @@ -389,7 +389,7 @@ describe('Participant', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -427,7 +427,7 @@ describe('Participant', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each({callback: () => done()}, () => fail('wrong callback!')); @@ -435,7 +435,7 @@ describe('Participant', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.list(); @@ -457,7 +457,7 @@ describe('Participant', function() { ); it('should generate valid read response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -495,7 +495,7 @@ describe('Participant', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/conversations/v1/conversation/webhook.spec.js b/spec/integration/rest/conversations/v1/conversation/webhook.spec.js index 6966ba2dd6..799bc997a5 100644 --- a/spec/integration/rest/conversations/v1/conversation/webhook.spec.js +++ b/spec/integration/rest/conversations/v1/conversation/webhook.spec.js @@ -31,7 +31,7 @@ describe('Webhook', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -89,7 +89,7 @@ describe('Webhook', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each(() => done()); @@ -97,7 +97,7 @@ describe('Webhook', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -155,7 +155,7 @@ describe('Webhook', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each({pageSize: 20}, () => done()); @@ -168,7 +168,7 @@ describe('Webhook', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -226,7 +226,7 @@ describe('Webhook', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.each({callback: () => done()}, () => fail('wrong callback!')); @@ -234,7 +234,7 @@ describe('Webhook', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks.list(); @@ -256,7 +256,7 @@ describe('Webhook', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -314,7 +314,7 @@ describe('Webhook', function() { 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -330,7 +330,7 @@ describe('Webhook', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -341,7 +341,7 @@ describe('Webhook', function() { 'key': 'webhooks' }, 'webhooks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -357,7 +357,7 @@ describe('Webhook', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -380,7 +380,7 @@ describe('Webhook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -391,7 +391,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -407,7 +407,7 @@ describe('Webhook', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {target: 'webhook'}; var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -432,7 +432,7 @@ describe('Webhook', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -448,7 +448,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -465,7 +465,7 @@ describe('Webhook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -488,7 +488,7 @@ describe('Webhook', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'conversation_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -504,7 +504,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:51Z', 'url': 'https://conversations.twilio.com/v1/Conversations/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -520,7 +520,7 @@ describe('Webhook', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.conversations('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .webhooks('WHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -543,7 +543,7 @@ describe('Webhook', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/conversations/v1/webhook.spec.js b/spec/integration/rest/conversations/v1/webhook.spec.js index 412df440ea..f13ca754a3 100644 --- a/spec/integration/rest/conversations/v1/webhook.spec.js +++ b/spec/integration/rest/conversations/v1/webhook.spec.js @@ -31,7 +31,7 @@ describe('Webhook', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.webhooks().fetch(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Webhook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'pre_webhook_url': 'https://example.com/pre', 'post_webhook_url': 'https://example.com/post', @@ -62,7 +62,7 @@ describe('Webhook', function() { ], 'target': 'webhook', 'url': 'https://conversations.twilio.com/v1/Conversations/Webhooks' - }); + }; holodeck.mock(new Response(200, body)); @@ -77,7 +77,7 @@ describe('Webhook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.conversations.v1.webhooks().update(); promise.then(function() { @@ -97,7 +97,7 @@ describe('Webhook', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'pre_webhook_url': 'https://example.com/pre', 'post_webhook_url': 'http://example.com/post', @@ -107,7 +107,7 @@ describe('Webhook', function() { ], 'target': 'webhook', 'url': 'https://conversations.twilio.com/v1/Conversations/Webhooks' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/fax/v1/fax.spec.js b/spec/integration/rest/fax/v1/fax.spec.js index fc5d20a2c1..3364c3e353 100644 --- a/spec/integration/rest/fax/v1/fax.spec.js +++ b/spec/integration/rest/fax/v1/fax.spec.js @@ -31,7 +31,7 @@ describe('Fax', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Fax', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': 'v1', 'date_created': '2015-07-30T20:00:00Z', @@ -73,7 +73,7 @@ describe('Fax', function() { 'media': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' }, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -88,7 +88,7 @@ describe('Fax', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'faxes': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -122,14 +122,14 @@ describe('Fax', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes?To=%2B14155554321&From=%2B14155551234&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'faxes': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -163,7 +163,7 @@ describe('Fax', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes?To=%2B14155554321&From=%2B14155551234&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -175,7 +175,7 @@ describe('Fax', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'faxes': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -209,14 +209,14 @@ describe('Fax', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes?To=%2B14155554321&From=%2B14155551234&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes.list(); promise.then(function() { @@ -236,7 +236,7 @@ describe('Fax', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'faxes': [], 'meta': { 'first_page_url': 'https://fax.twilio.com/v1/Faxes?DateCreatedOnOrBefore=2017-04-01T00%3A00%3A00Z&To=%2B14155554321&DateCreatedAfter=2017-03-31T00%3A00%3A00Z&From=%2B14155551234&PageSize=50&Page=0', @@ -247,7 +247,7 @@ describe('Fax', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes?DateCreatedOnOrBefore=2017-04-01T00%3A00%3A00Z&To=%2B14155554321&DateCreatedAfter=2017-03-31T00%3A00%3A00Z&From=%2B14155551234&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -262,7 +262,7 @@ describe('Fax', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'faxes': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -296,7 +296,7 @@ describe('Fax', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes?To=%2B14155554321&From=%2B14155551234&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -311,7 +311,7 @@ describe('Fax', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: 'to', mediaUrl: 'https://example.com'}; var promise = client.fax.v1.faxes.create(opts); @@ -334,7 +334,7 @@ describe('Fax', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': 'v1', 'date_created': '2015-07-30T20:00:00Z', @@ -355,7 +355,7 @@ describe('Fax', function() { 'media': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' }, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -371,7 +371,7 @@ describe('Fax', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -392,7 +392,7 @@ describe('Fax', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': 'v1', 'date_created': '2015-07-30T20:00:00Z', @@ -413,7 +413,7 @@ describe('Fax', function() { 'media': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' }, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -428,7 +428,7 @@ describe('Fax', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -449,7 +449,7 @@ describe('Fax', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/fax/v1/fax/faxMedia.spec.js b/spec/integration/rest/fax/v1/fax/faxMedia.spec.js index a5f2535b24..ab2e13aa46 100644 --- a/spec/integration/rest/fax/v1/fax/faxMedia.spec.js +++ b/spec/integration/rest/fax/v1/fax/faxMedia.spec.js @@ -31,7 +31,7 @@ describe('FaxMedia', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media('MEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('FaxMedia', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'content_type': 'application/pdf', 'date_created': '2015-07-30T20:00:00Z', @@ -62,7 +62,7 @@ describe('FaxMedia', function() { 'fax_sid': 'FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media/MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('FaxMedia', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'media': [ { 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -99,7 +99,7 @@ describe('FaxMedia', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media.each(() => done()); @@ -107,7 +107,7 @@ describe('FaxMedia', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'media': [ { 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -128,7 +128,7 @@ describe('FaxMedia', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media.each({pageSize: 20}, () => done()); @@ -141,7 +141,7 @@ describe('FaxMedia', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'media': [ { 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -162,7 +162,7 @@ describe('FaxMedia', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media.each({callback: () => done()}, () => fail('wrong callback!')); @@ -170,7 +170,7 @@ describe('FaxMedia', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media.list(); @@ -192,7 +192,7 @@ describe('FaxMedia', function() { ); it('should generate valid read response', function(done) { - var body = JSON.stringify({ + var body = { 'media': [ { 'sid': 'MEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -213,7 +213,7 @@ describe('FaxMedia', function() { 'previous_page_url': null, 'url': 'https://fax.twilio.com/v1/Faxes/FXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -229,7 +229,7 @@ describe('FaxMedia', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.fax.v1.faxes('FXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .media('MEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -252,7 +252,7 @@ describe('FaxMedia', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/flexApi/v1/channel.spec.js b/spec/integration/rest/flexApi/v1/channel.spec.js index 255ab9ec38..789428e171 100644 --- a/spec/integration/rest/flexApi/v1/channel.spec.js +++ b/spec/integration/rest/flexApi/v1/channel.spec.js @@ -31,7 +31,7 @@ describe('Channel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -53,14 +53,14 @@ describe('Channel', function() { 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.channel.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -82,7 +82,7 @@ describe('Channel', function() { 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.channel.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Channel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -116,14 +116,14 @@ describe('Channel', function() { 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.channel.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.channel.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Channel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -165,7 +165,7 @@ describe('Channel', function() { 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Channel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -191,7 +191,7 @@ describe('Channel', function() { 'key': 'flex_chat_channels' }, 'flex_chat_channels': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Channel', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -227,7 +227,7 @@ describe('Channel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'flex_flow_sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -236,7 +236,7 @@ describe('Channel', function() { 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -251,7 +251,7 @@ describe('Channel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { flexFlowSid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', @@ -284,7 +284,7 @@ describe('Channel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'flex_flow_sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -293,7 +293,7 @@ describe('Channel', function() { 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', 'url': 'https://flex-api.twilio.com/v1/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -314,7 +314,7 @@ describe('Channel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.channel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -335,7 +335,7 @@ describe('Channel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/flexApi/v1/configuration.spec.js b/spec/integration/rest/flexApi/v1/configuration.spec.js index 8ec90f37d3..4603c5fc40 100644 --- a/spec/integration/rest/flexApi/v1/configuration.spec.js +++ b/spec/integration/rest/flexApi/v1/configuration.spec.js @@ -31,7 +31,7 @@ describe('Configuration', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.configuration().fetch(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Configuration', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -170,7 +170,7 @@ describe('Configuration', function() { 'ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab' ], 'url': 'https://flex-api.twilio.com/v1/Configuration' - }); + }; holodeck.mock(new Response(200, body)); @@ -185,7 +185,7 @@ describe('Configuration', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.configuration().create(); promise.then(function() { @@ -205,7 +205,7 @@ describe('Configuration', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -324,7 +324,7 @@ describe('Configuration', function() { 'ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab' ], 'url': 'https://flex-api.twilio.com/v1/Configuration' - }); + }; holodeck.mock(new Response(201, body)); @@ -339,7 +339,7 @@ describe('Configuration', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.configuration().update(); promise.then(function() { @@ -359,7 +359,7 @@ describe('Configuration', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -478,7 +478,7 @@ describe('Configuration', function() { 'ZSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab' ], 'url': 'https://flex-api.twilio.com/v1/Configuration' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/flexApi/v1/flexFlow.spec.js b/spec/integration/rest/flexApi/v1/flexFlow.spec.js index a6d009fa6a..8ddbae355a 100644 --- a/spec/integration/rest/flexApi/v1/flexFlow.spec.js +++ b/spec/integration/rest/flexApi/v1/flexFlow.spec.js @@ -31,7 +31,7 @@ describe('FlexFlow', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -62,14 +62,14 @@ describe('FlexFlow', function() { 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.flexFlow.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -100,7 +100,7 @@ describe('FlexFlow', function() { 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.flexFlow.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -112,7 +112,7 @@ describe('FlexFlow', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -143,14 +143,14 @@ describe('FlexFlow', function() { 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.flexFlow.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.flexFlow.list(); promise.then(function() { @@ -170,7 +170,7 @@ describe('FlexFlow', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -201,7 +201,7 @@ describe('FlexFlow', function() { 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -216,7 +216,7 @@ describe('FlexFlow', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -227,7 +227,7 @@ describe('FlexFlow', function() { 'key': 'flex_flows' }, 'flex_flows': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -242,7 +242,7 @@ describe('FlexFlow', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.flexFlow('FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -263,7 +263,7 @@ describe('FlexFlow', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', @@ -281,7 +281,7 @@ describe('FlexFlow', function() { 'long_lived': true, 'janitor_enabled': true, 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('FlexFlow', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { friendlyName: 'friendly_name', @@ -327,7 +327,7 @@ describe('FlexFlow', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', @@ -345,7 +345,7 @@ describe('FlexFlow', function() { 'long_lived': true, 'janitor_enabled': true, 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -365,7 +365,7 @@ describe('FlexFlow', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.flexFlow('FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -386,7 +386,7 @@ describe('FlexFlow', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', @@ -404,7 +404,7 @@ describe('FlexFlow', function() { 'long_lived': true, 'janitor_enabled': true, 'url': 'https://flex-api.twilio.com/v1/FlexFlows/FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -419,7 +419,7 @@ describe('FlexFlow', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.flexFlow('FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -440,7 +440,7 @@ describe('FlexFlow', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/flexApi/v1/webChannel.spec.js b/spec/integration/rest/flexApi/v1/webChannel.spec.js index 7838f72216..eaa9ddf243 100644 --- a/spec/integration/rest/flexApi/v1/webChannel.spec.js +++ b/spec/integration/rest/flexApi/v1/webChannel.spec.js @@ -31,7 +31,7 @@ describe('WebChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -51,14 +51,14 @@ describe('WebChannel', function() { 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.webChannel.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -78,7 +78,7 @@ describe('WebChannel', function() { 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.webChannel.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -90,7 +90,7 @@ describe('WebChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -110,14 +110,14 @@ describe('WebChannel', function() { 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.flexApi.v1.webChannel.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.webChannel.list(); promise.then(function() { @@ -137,7 +137,7 @@ describe('WebChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -157,7 +157,7 @@ describe('WebChannel', function() { 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -172,7 +172,7 @@ describe('WebChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -183,7 +183,7 @@ describe('WebChannel', function() { 'key': 'flex_chat_channels' }, 'flex_chat_channels': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -198,7 +198,7 @@ describe('WebChannel', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.webChannel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -219,14 +219,14 @@ describe('WebChannel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'flex_flow_sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -241,7 +241,7 @@ describe('WebChannel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { flexFlowSid: 'FOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', @@ -274,14 +274,14 @@ describe('WebChannel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'flex_flow_sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -302,7 +302,7 @@ describe('WebChannel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.webChannel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -323,14 +323,14 @@ describe('WebChannel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'flex_flow_sid': 'FOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', 'url': 'https://flex-api.twilio.com/v1/WebChannels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -345,7 +345,7 @@ describe('WebChannel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.flexApi.v1.webChannel('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -366,7 +366,7 @@ describe('WebChannel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/insights/v1/call.spec.js b/spec/integration/rest/insights/v1/call.spec.js index ed1572e1f6..d31fd0beb6 100644 --- a/spec/integration/rest/insights/v1/call.spec.js +++ b/spec/integration/rest/insights/v1/call.spec.js @@ -31,7 +31,7 @@ describe('Call', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Call', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { @@ -60,7 +60,7 @@ describe('Call', function() { 'metrics': 'https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Metrics', 'summary': 'https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Summary' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/insights/v1/call/event.spec.js b/spec/integration/rest/insights/v1/call/event.spec.js index 38a5e9e2ae..b1208ad34f 100644 --- a/spec/integration/rest/insights/v1/call/event.spec.js +++ b/spec/integration/rest/insights/v1/call/event.spec.js @@ -31,7 +31,7 @@ describe('Event', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -87,7 +87,7 @@ describe('Event', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each(() => done()); @@ -95,7 +95,7 @@ describe('Event', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -151,7 +151,7 @@ describe('Event', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each({pageSize: 20}, () => done()); @@ -164,7 +164,7 @@ describe('Event', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -220,7 +220,7 @@ describe('Event', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each({callback: () => done()}, () => fail('wrong callback!')); @@ -228,7 +228,7 @@ describe('Event', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.list(); @@ -250,7 +250,7 @@ describe('Event', function() { ); it('should generate valid read response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -306,7 +306,7 @@ describe('Event', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -322,7 +322,7 @@ describe('Event', function() { ); it('should generate valid read_deep response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 10, 'page_size': 5, @@ -378,7 +378,7 @@ describe('Event', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/insights/v1/call/metric.spec.js b/spec/integration/rest/insights/v1/call/metric.spec.js index b8daed1b9a..5a7f7fc7cd 100644 --- a/spec/integration/rest/insights/v1/call/metric.spec.js +++ b/spec/integration/rest/insights/v1/call/metric.spec.js @@ -31,7 +31,7 @@ describe('Metric', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -81,7 +81,7 @@ describe('Metric', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .metrics.each(() => done()); @@ -89,7 +89,7 @@ describe('Metric', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -139,7 +139,7 @@ describe('Metric', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .metrics.each({pageSize: 20}, () => done()); @@ -152,7 +152,7 @@ describe('Metric', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -202,7 +202,7 @@ describe('Metric', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .metrics.each({callback: () => done()}, () => fail('wrong callback!')); @@ -210,7 +210,7 @@ describe('Metric', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .metrics.list(); @@ -232,7 +232,7 @@ describe('Metric', function() { ); it('should generate valid read response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -282,7 +282,7 @@ describe('Metric', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -298,7 +298,7 @@ describe('Metric', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 10, 'page_size': 5, @@ -348,7 +348,7 @@ describe('Metric', function() { 'sip_edge': null } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/insights/v1/call/summary.spec.js b/spec/integration/rest/insights/v1/call/summary.spec.js index d058208a8c..690afb9434 100644 --- a/spec/integration/rest/insights/v1/call/summary.spec.js +++ b/spec/integration/rest/insights/v1/call/summary.spec.js @@ -31,7 +31,7 @@ describe('CallSummary', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.insights.v1.calls('CAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .summary().fetch(); @@ -53,7 +53,7 @@ describe('CallSummary', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_sid': 'CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'call_type': 'carrier', @@ -75,7 +75,7 @@ describe('CallSummary', function() { 'attributes': {}, 'properties': {}, 'url': 'https://insights.twilio.com/v1/Voice/CAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Summary' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/credential.spec.js b/spec/integration/rest/ipMessaging/v1/credential.spec.js index 69b4a595f9..54e623db02 100644 --- a/spec/integration/rest/ipMessaging/v1/credential.spec.js +++ b/spec/integration/rest/ipMessaging/v1/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -53,14 +53,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.credentials.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -82,7 +82,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.credentials.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.credentials.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.credentials.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'gcm'}; var promise = client.ipMessaging.v1.credentials.create(opts); @@ -229,7 +229,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -238,7 +238,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -254,7 +254,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -275,7 +275,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -284,7 +284,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -320,7 +320,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -329,7 +329,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -344,7 +344,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service.spec.js b/spec/integration/rest/ipMessaging/v1/service.spec.js index 4da932c36f..f2c351cb81 100644 --- a/spec/integration/rest/ipMessaging/v1/service.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -80,7 +80,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(200, body)); @@ -95,7 +95,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -116,7 +116,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -131,7 +131,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.ipMessaging.v1.services.create(opts); @@ -154,7 +154,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -182,7 +182,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(201, body)); @@ -198,7 +198,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -239,14 +239,14 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -287,7 +287,7 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -299,7 +299,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -340,14 +340,14 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services.list(); promise.then(function() { @@ -367,7 +367,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -378,7 +378,7 @@ describe('Service', function() { 'url': 'https://chat.twilio.com/v1/Services' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services?Page=0&PageSize=50', 'key': 'services', @@ -434,7 +434,7 @@ describe('Service', function() { 'webhooks': {} } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -449,7 +449,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -470,7 +470,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -498,7 +498,7 @@ describe('Service', function() { ], 'webhook_method': 'webhook_method', 'webhooks': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel.spec.js index 7cd9fdfb12..5aedd908e3 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel.spec.js @@ -31,7 +31,7 @@ describe('Channel', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Channel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -74,7 +74,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Channel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -113,7 +113,7 @@ describe('Channel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Channel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.create(); @@ -151,7 +151,7 @@ describe('Channel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -171,7 +171,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Channel', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -220,7 +220,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each(() => done()); @@ -228,7 +228,7 @@ describe('Channel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -261,7 +261,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({pageSize: 20}, () => done()); @@ -274,7 +274,7 @@ describe('Channel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -307,7 +307,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({callback: () => done()}, () => fail('wrong callback!')); @@ -315,7 +315,7 @@ describe('Channel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.list(); @@ -337,7 +337,7 @@ describe('Channel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -370,7 +370,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -386,7 +386,7 @@ describe('Channel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [], 'meta': { 'page': 0, @@ -397,7 +397,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -413,7 +413,7 @@ describe('Channel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -436,7 +436,7 @@ describe('Channel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -456,7 +456,7 @@ describe('Channel', function() { 'invites': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js index c1759cdf7f..96daa27526 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/invite.spec.js @@ -31,7 +31,7 @@ describe('Invite', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Invite', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -67,7 +67,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Invite', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Invite', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -122,7 +122,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -140,7 +140,7 @@ describe('Invite', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -164,7 +164,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -173,7 +173,7 @@ describe('Invite', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -197,7 +197,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -211,7 +211,7 @@ describe('Invite', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -235,7 +235,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -244,7 +244,7 @@ describe('Invite', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -268,7 +268,7 @@ describe('Invite', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [], 'meta': { 'first_page_url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0', @@ -279,7 +279,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Invite', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -320,7 +320,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Invite', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Invite', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js index f9e2852ef0..67b5d99fd9 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/member.spec.js @@ -31,7 +31,7 @@ describe('Member', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Member', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('Member', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Member', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -124,7 +124,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -142,7 +142,7 @@ describe('Member', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -167,7 +167,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -176,7 +176,7 @@ describe('Member', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -201,7 +201,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -215,7 +215,7 @@ describe('Member', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -240,7 +240,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -249,7 +249,7 @@ describe('Member', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -273,7 +273,7 @@ describe('Member', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -298,7 +298,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('Member', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -326,7 +326,7 @@ describe('Member', function() { 'key': 'members' }, 'members': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('Member', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -368,7 +368,7 @@ describe('Member', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -385,7 +385,7 @@ describe('Member', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -410,7 +410,7 @@ describe('Member', function() { ); it('should generate valid update_role_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -422,7 +422,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -439,7 +439,7 @@ describe('Member', function() { ); it('should generate valid update_last_consumed_message_index response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -451,7 +451,7 @@ describe('Member', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js b/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js index 0bc8d4e327..c68d99a98e 100644 --- a/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/channel/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -70,7 +70,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Message', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {body: 'body'}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -114,7 +114,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -128,7 +128,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -146,7 +146,7 @@ describe('Message', function() { ); it('should generate valid create_with_attributes response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -160,7 +160,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -178,7 +178,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -205,7 +205,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -214,7 +214,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -241,7 +241,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -255,7 +255,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -282,7 +282,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -291,7 +291,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -315,7 +315,7 @@ describe('Message', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -342,7 +342,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -359,7 +359,7 @@ describe('Message', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -370,7 +370,7 @@ describe('Message', function() { 'key': 'messages' }, 'messages': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -387,7 +387,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -412,7 +412,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -429,7 +429,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -454,7 +454,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -468,7 +468,7 @@ describe('Message', function() { 'body': 'Hello', 'index': 0, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/role.spec.js b/spec/integration/rest/ipMessaging/v1/service/role.spec.js index 654f2d9e17..0bd83676d5 100644 --- a/spec/integration/rest/ipMessaging/v1/service/role.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/role.spec.js @@ -33,7 +33,7 @@ describe('Role', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('Role', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Role', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('Role', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('Role', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Role', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -170,7 +170,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Role', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each(() => done()); @@ -223,7 +223,7 @@ describe('Role', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -251,7 +251,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({pageSize: 20}, () => done()); @@ -264,7 +264,7 @@ describe('Role', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -292,7 +292,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({callback: () => done()}, () => fail('wrong callback!')); @@ -300,7 +300,7 @@ describe('Role', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.list(); @@ -322,7 +322,7 @@ describe('Role', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -350,7 +350,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -366,7 +366,7 @@ describe('Role', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -377,7 +377,7 @@ describe('Role', function() { 'key': 'roles' }, 'roles': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Role', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {permission: ['permission']}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('Role', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -434,7 +434,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/user.spec.js b/spec/integration/rest/ipMessaging/v1/service/user.spec.js index df7c0285c8..b81033e664 100644 --- a/spec/integration/rest/ipMessaging/v1/service/user.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/user.spec.js @@ -31,7 +31,7 @@ describe('User', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('User', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('User', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('User', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('User', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -151,7 +151,7 @@ describe('User', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -168,7 +168,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -185,7 +185,7 @@ describe('User', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each(() => done()); @@ -223,7 +223,7 @@ describe('User', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -253,7 +253,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({pageSize: 20}, () => done()); @@ -266,7 +266,7 @@ describe('User', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -296,7 +296,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({callback: () => done()}, () => fail('wrong callback!')); @@ -304,7 +304,7 @@ describe('User', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.list(); @@ -326,7 +326,7 @@ describe('User', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -356,7 +356,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -372,7 +372,7 @@ describe('User', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -383,7 +383,7 @@ describe('User', function() { 'key': 'users' }, 'users': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -399,7 +399,7 @@ describe('User', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -422,7 +422,7 @@ describe('User', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -439,7 +439,7 @@ describe('User', function() { 'user_channels': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'url': 'https://chat.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v1/service/user/userChannel.spec.js b/spec/integration/rest/ipMessaging/v1/service/user/userChannel.spec.js index 954c6e890d..86333ce465 100644 --- a/spec/integration/rest/ipMessaging/v1/service/user/userChannel.spec.js +++ b/spec/integration/rest/ipMessaging/v1/service/user/userChannel.spec.js @@ -31,7 +31,7 @@ describe('UserChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -56,7 +56,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -65,7 +65,7 @@ describe('UserChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -90,7 +90,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -104,7 +104,7 @@ describe('UserChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -129,7 +129,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -138,7 +138,7 @@ describe('UserChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -162,7 +162,7 @@ describe('UserChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -187,7 +187,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -204,7 +204,7 @@ describe('UserChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('UserChannel', function() { 'key': 'channels' }, 'channels': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/credential.spec.js b/spec/integration/rest/ipMessaging/v2/credential.spec.js index 1fd1e3f258..547d08a554 100644 --- a/spec/integration/rest/ipMessaging/v2/credential.spec.js +++ b/spec/integration/rest/ipMessaging/v2/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -53,14 +53,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.credentials.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -82,7 +82,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.credentials.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.credentials.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.credentials.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'gcm'}; var promise = client.ipMessaging.v2.credentials.create(opts); @@ -229,7 +229,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -238,7 +238,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -254,7 +254,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -275,7 +275,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -284,7 +284,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -320,7 +320,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -329,7 +329,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://chat.twilio.com/v2/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -344,7 +344,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service.spec.js b/spec/integration/rest/ipMessaging/v2/service.spec.js index b49466c89c..aac9052cac 100644 --- a/spec/integration/rest/ipMessaging/v2/service.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -89,7 +89,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'media compatibility message' } - }); + }; holodeck.mock(new Response(200, body)); @@ -104,7 +104,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -125,7 +125,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -140,7 +140,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.ipMessaging.v2.services.create(opts); @@ -163,7 +163,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -200,7 +200,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'media compatibility message' } - }); + }; holodeck.mock(new Response(201, body)); @@ -216,7 +216,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -266,14 +266,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -323,7 +323,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -335,7 +335,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -385,14 +385,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services.list(); promise.then(function() { @@ -412,7 +412,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -423,7 +423,7 @@ describe('Service', function() { 'url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -438,7 +438,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services?PageSize=50&Page=0', 'key': 'services', @@ -488,7 +488,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -503,7 +503,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -524,7 +524,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'consumption_report_interval': 100, 'date_created': '2015-07-30T20:00:00Z', @@ -580,7 +580,7 @@ describe('Service', function() { 'size_limit_mb': 150, 'compatibility_message': 'new media compatibility message' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/binding.spec.js b/spec/integration/rest/ipMessaging/v2/service/binding.spec.js index f64fea3693..a0ccf332d5 100644 --- a/spec/integration/rest/ipMessaging/v2/service/binding.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/binding.spec.js @@ -31,7 +31,7 @@ describe('Binding', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -64,7 +64,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each(() => done()); @@ -72,7 +72,7 @@ describe('Binding', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -105,7 +105,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({pageSize: 20}, () => done()); @@ -118,7 +118,7 @@ describe('Binding', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -151,7 +151,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({callback: () => done()}, () => fail('wrong callback!')); @@ -159,7 +159,7 @@ describe('Binding', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.list(); @@ -181,7 +181,7 @@ describe('Binding', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -214,7 +214,7 @@ describe('Binding', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -230,7 +230,7 @@ describe('Binding', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -241,7 +241,7 @@ describe('Binding', function() { 'key': 'bindings' }, 'bindings': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -257,7 +257,7 @@ describe('Binding', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -280,7 +280,7 @@ describe('Binding', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -300,7 +300,7 @@ describe('Binding', function() { 'links': { 'user': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/TestUser' } - }); + }; holodeck.mock(new Response(200, body)); @@ -316,7 +316,7 @@ describe('Binding', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -339,7 +339,7 @@ describe('Binding', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel.spec.js index 1917b0e578..c60b3e9ff2 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel.spec.js @@ -31,7 +31,7 @@ describe('Channel', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Channel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -75,7 +75,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('Channel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Channel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -133,7 +133,7 @@ describe('Channel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -158,7 +158,7 @@ describe('Channel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(201, body)); @@ -195,7 +195,7 @@ describe('Channel', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -229,7 +229,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each(() => done()); @@ -237,7 +237,7 @@ describe('Channel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -271,7 +271,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({pageSize: 20}, () => done()); @@ -284,7 +284,7 @@ describe('Channel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -318,7 +318,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.each({callback: () => done()}, () => fail('wrong callback!')); @@ -326,7 +326,7 @@ describe('Channel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels.list(); @@ -348,7 +348,7 @@ describe('Channel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -382,7 +382,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -398,7 +398,7 @@ describe('Channel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [], 'meta': { 'page': 0, @@ -409,7 +409,7 @@ describe('Channel', function() { 'next_page_url': null, 'key': 'channels' } - }); + }; holodeck.mock(new Response(200, body)); @@ -425,7 +425,7 @@ describe('Channel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -451,7 +451,7 @@ describe('Channel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -472,7 +472,7 @@ describe('Channel', function() { 'webhooks': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks', 'last_message': null } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js index 27210006ac..8c4ab18bb9 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/invite.spec.js @@ -31,7 +31,7 @@ describe('Invite', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Invite', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -67,7 +67,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Invite', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Invite', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', @@ -122,7 +122,7 @@ describe('Invite', function() { 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites/INaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -140,7 +140,7 @@ describe('Invite', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -164,7 +164,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -173,7 +173,7 @@ describe('Invite', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -197,7 +197,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -211,7 +211,7 @@ describe('Invite', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -235,7 +235,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -244,7 +244,7 @@ describe('Invite', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -268,7 +268,7 @@ describe('Invite', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [], 'meta': { 'first_page_url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0', @@ -279,7 +279,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Invite', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'invites': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -320,7 +320,7 @@ describe('Invite', function() { 'previous_page_url': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Invites?Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -337,7 +337,7 @@ describe('Invite', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Invite', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js index b36d1ec203..a00b1ab569 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/member.spec.js @@ -31,7 +31,7 @@ describe('Member', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Member', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:50Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Member', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -120,7 +120,7 @@ describe('Member', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -133,7 +133,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:50Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -151,7 +151,7 @@ describe('Member', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -177,7 +177,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -186,7 +186,7 @@ describe('Member', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -212,7 +212,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -226,7 +226,7 @@ describe('Member', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -252,7 +252,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -261,7 +261,7 @@ describe('Member', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -285,7 +285,7 @@ describe('Member', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -311,7 +311,7 @@ describe('Member', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -328,7 +328,7 @@ describe('Member', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -339,7 +339,7 @@ describe('Member', function() { 'key': 'members' }, 'members': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -356,7 +356,7 @@ describe('Member', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -384,7 +384,7 @@ describe('Member', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -401,7 +401,7 @@ describe('Member', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -429,7 +429,7 @@ describe('Member', function() { ); it('should generate valid update_role_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -442,7 +442,7 @@ describe('Member', function() { 'date_updated': '2016-03-24T21:05:51Z', 'attributes': '{}', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/message.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/message.spec.js index 9f445071fe..634e0c6fe1 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/message.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/message.spec.js @@ -31,7 +31,7 @@ describe('Message', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Message', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -73,7 +73,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Message', function() { ); it('should generate valid fetch_media response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -112,7 +112,7 @@ describe('Message', function() { 'filename': 'hello.pdf' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -129,7 +129,7 @@ describe('Message', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -156,7 +156,7 @@ describe('Message', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -173,7 +173,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -190,7 +190,7 @@ describe('Message', function() { ); it('should generate valid create_with_all response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -207,7 +207,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -224,7 +224,7 @@ describe('Message', function() { ); it('should generate valid create_media response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -246,7 +246,7 @@ describe('Message', function() { 'filename': 'hello.pdf' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -263,7 +263,7 @@ describe('Message', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -316,7 +316,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -325,7 +325,7 @@ describe('Message', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -378,7 +378,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -392,7 +392,7 @@ describe('Message', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -445,7 +445,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -454,7 +454,7 @@ describe('Message', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -478,7 +478,7 @@ describe('Message', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -531,7 +531,7 @@ describe('Message', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -548,7 +548,7 @@ describe('Message', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -559,7 +559,7 @@ describe('Message', function() { 'key': 'messages' }, 'messages': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -576,7 +576,7 @@ describe('Message', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -604,7 +604,7 @@ describe('Message', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -621,7 +621,7 @@ describe('Message', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -649,7 +649,7 @@ describe('Message', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -666,7 +666,7 @@ describe('Message', function() { 'type': 'text', 'media': null, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Messages/IMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js b/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js index f903a3c054..ce300350a3 100644 --- a/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/channel/webhook.spec.js @@ -31,7 +31,7 @@ describe('Webhook', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -94,7 +94,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -103,7 +103,7 @@ describe('Webhook', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -166,7 +166,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -180,7 +180,7 @@ describe('Webhook', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -243,7 +243,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -252,7 +252,7 @@ describe('Webhook', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -276,7 +276,7 @@ describe('Webhook', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -339,7 +339,7 @@ describe('Webhook', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -356,7 +356,7 @@ describe('Webhook', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 5, @@ -367,7 +367,7 @@ describe('Webhook', function() { 'key': 'webhooks' }, 'webhooks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -384,7 +384,7 @@ describe('Webhook', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -409,7 +409,7 @@ describe('Webhook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -421,7 +421,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -438,7 +438,7 @@ describe('Webhook', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'webhook'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -465,7 +465,7 @@ describe('Webhook', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -483,7 +483,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:50Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -501,7 +501,7 @@ describe('Webhook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -526,7 +526,7 @@ describe('Webhook', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -544,7 +544,7 @@ describe('Webhook', function() { 'date_created': '2016-03-24T21:05:50Z', 'date_updated': '2016-03-24T21:05:51Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Webhooks/WHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -561,7 +561,7 @@ describe('Webhook', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .channels('CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -586,7 +586,7 @@ describe('Webhook', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/role.spec.js b/spec/integration/rest/ipMessaging/v2/service/role.spec.js index 1fc6a7e591..65bcb3aa03 100644 --- a/spec/integration/rest/ipMessaging/v2/service/role.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/role.spec.js @@ -33,7 +33,7 @@ describe('Role', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('Role', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Role', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles('RLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('Role', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('Role', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'channel', permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Role', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -170,7 +170,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('Role', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -215,7 +215,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each(() => done()); @@ -223,7 +223,7 @@ describe('Role', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -251,7 +251,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({pageSize: 20}, () => done()); @@ -264,7 +264,7 @@ describe('Role', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -292,7 +292,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.each({callback: () => done()}, () => fail('wrong callback!')); @@ -300,7 +300,7 @@ describe('Role', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .roles.list(); @@ -322,7 +322,7 @@ describe('Role', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -350,7 +350,7 @@ describe('Role', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -366,7 +366,7 @@ describe('Role', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -377,7 +377,7 @@ describe('Role', function() { 'key': 'roles' }, 'roles': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('Role', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {permission: ['permission']}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('Role', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -434,7 +434,7 @@ describe('Role', function() { 'date_created': '2016-03-03T19:47:15Z', 'date_updated': '2016-03-03T19:47:15Z', 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Roles/RLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/user.spec.js b/spec/integration/rest/ipMessaging/v2/service/user.spec.js index 993f158640..98b9f6704d 100644 --- a/spec/integration/rest/ipMessaging/v2/service/user.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/user.spec.js @@ -31,7 +31,7 @@ describe('User', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('User', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -88,7 +88,7 @@ describe('User', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -111,7 +111,7 @@ describe('User', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -127,7 +127,7 @@ describe('User', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('User', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -177,7 +177,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -194,7 +194,7 @@ describe('User', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -225,7 +225,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each(() => done()); @@ -233,7 +233,7 @@ describe('User', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -264,7 +264,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({pageSize: 20}, () => done()); @@ -277,7 +277,7 @@ describe('User', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -308,7 +308,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.each({callback: () => done()}, () => fail('wrong callback!')); @@ -316,7 +316,7 @@ describe('User', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users.list(); @@ -338,7 +338,7 @@ describe('User', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -369,7 +369,7 @@ describe('User', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -385,7 +385,7 @@ describe('User', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -396,7 +396,7 @@ describe('User', function() { 'key': 'users' }, 'users': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -412,7 +412,7 @@ describe('User', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xTwilioWebhookEnabled: 'true'}; var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -438,7 +438,7 @@ describe('User', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -456,7 +456,7 @@ describe('User', function() { 'user_bindings': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings' }, 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js b/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js index cc219745ff..e674ddb8ba 100644 --- a/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/user/userBinding.spec.js @@ -31,7 +31,7 @@ describe('UserBinding', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -62,7 +62,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -71,7 +71,7 @@ describe('UserBinding', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -102,7 +102,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -116,7 +116,7 @@ describe('UserBinding', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -147,7 +147,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -156,7 +156,7 @@ describe('UserBinding', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -180,7 +180,7 @@ describe('UserBinding', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -211,7 +211,7 @@ describe('UserBinding', function() { 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -228,7 +228,7 @@ describe('UserBinding', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -239,7 +239,7 @@ describe('UserBinding', function() { 'key': 'bindings' }, 'bindings': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -256,7 +256,7 @@ describe('UserBinding', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -281,7 +281,7 @@ describe('UserBinding', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -299,7 +299,7 @@ describe('UserBinding', function() { 'invited_to_channel' ], 'url': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/USaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -316,7 +316,7 @@ describe('UserBinding', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -341,7 +341,7 @@ describe('UserBinding', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js b/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js index f8542c2043..c077da5500 100644 --- a/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js +++ b/spec/integration/rest/ipMessaging/v2/service/user/userChannel.spec.js @@ -31,7 +31,7 @@ describe('UserChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -59,7 +59,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -68,7 +68,7 @@ describe('UserChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -96,7 +96,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -110,7 +110,7 @@ describe('UserChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -138,7 +138,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -147,7 +147,7 @@ describe('UserChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -171,7 +171,7 @@ describe('UserChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -199,7 +199,7 @@ describe('UserChannel', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -216,7 +216,7 @@ describe('UserChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -227,7 +227,7 @@ describe('UserChannel', function() { 'key': 'channels' }, 'channels': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('UserChannel', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -269,7 +269,7 @@ describe('UserChannel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -284,7 +284,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('UserChannel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -326,7 +326,7 @@ describe('UserChannel', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -343,7 +343,7 @@ describe('UserChannel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.ipMessaging.v2.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .users('USXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -368,7 +368,7 @@ describe('UserChannel', function() { ); it('should generate valid update_notification_level response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -383,7 +383,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -400,7 +400,7 @@ describe('UserChannel', function() { ); it('should generate valid update_last_consumed_message_index response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'channel_sid': 'CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -415,7 +415,7 @@ describe('UserChannel', function() { 'channel': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'member': 'https://chat.twilio.com/v2/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/CHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Members/MBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/lookups/v1/phoneNumber.spec.js b/spec/integration/rest/lookups/v1/phoneNumber.spec.js index 2c62c8ec3a..b61005cb80 100644 --- a/spec/integration/rest/lookups/v1/phoneNumber.spec.js +++ b/spec/integration/rest/lookups/v1/phoneNumber.spec.js @@ -31,7 +31,7 @@ describe('PhoneNumber', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.lookups.v1.phoneNumbers('+15017122661').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': null, 'carrier': null, 'fraud': null, @@ -61,7 +61,7 @@ describe('PhoneNumber', function() { 'national_format': '(510) 867-5310', 'phone_number': '+15108675310', 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+15108675310' - }); + }; holodeck.mock(new Response(200, body)); @@ -76,7 +76,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_carrier response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': null, 'carrier': { 'error_code': null, @@ -91,7 +91,7 @@ describe('PhoneNumber', function() { 'fraud': null, 'add_ons': null, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier' - }); + }; holodeck.mock(new Response(200, body)); @@ -106,7 +106,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_carrier_international response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': null, 'carrier': { 'error_code': null, @@ -121,7 +121,7 @@ describe('PhoneNumber', function() { 'fraud': null, 'add_ons': null, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+4402077651182?Type=carrier' - }); + }; holodeck.mock(new Response(200, body)); @@ -136,7 +136,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_caller_name response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': { 'caller_name': 'Delicious Cheese Cake', 'caller_type': 'CONSUMER', @@ -149,7 +149,7 @@ describe('PhoneNumber', function() { 'phone_number': '+15108675310', 'add_ons': null, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=caller-name' - }); + }; holodeck.mock(new Response(200, body)); @@ -164,7 +164,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_carrier_and_caller_name response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': { 'caller_name': 'Delicious Cheese Cake', 'caller_type': 'CONSUMER', @@ -188,7 +188,7 @@ describe('PhoneNumber', function() { 'results': {} }, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+15108675310?Type=carrier&Type=caller-name' - }); + }; holodeck.mock(new Response(200, body)); @@ -203,7 +203,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_addons_whitepages_pro response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': { 'caller_name': 'EMPIRE STATE BUILDING', 'caller_type': 'BUSINESS', @@ -265,7 +265,7 @@ describe('PhoneNumber', function() { } }, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+12127363100?Type=caller-name' - }); + }; holodeck.mock(new Response(200, body)); @@ -280,7 +280,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_addons_nomorobo response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': null, 'country_code': 'US', 'phone_number': '+19892008374', @@ -312,7 +312,7 @@ describe('PhoneNumber', function() { } }, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+19892008374?Type=carrier' - }); + }; holodeck.mock(new Response(200, body)); @@ -327,7 +327,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch_addons_payfone response', function(done) { - var body = JSON.stringify({ + var body = { 'caller_name': null, 'country_code': 'US', 'phone_number': '+16502530000', @@ -364,7 +364,7 @@ describe('PhoneNumber', function() { } }, 'url': 'https://lookups.twilio.com/v1/PhoneNumbers/+16502530000?Type=carrier' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/messaging/v1/service.spec.js b/spec/integration/rest/messaging/v1/service.spec.js index 0f73bffaba..ecc057fbaa 100644 --- a/spec/integration/rest/messaging/v1/service.spec.js +++ b/spec/integration/rest/messaging/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.messaging.v1.services.create(opts); @@ -54,7 +54,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:12:31Z', @@ -81,7 +81,7 @@ describe('Service', function() { 'broadcasts': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Broadcasts' }, 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -97,7 +97,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -118,7 +118,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'My Service!', 'sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -145,7 +145,7 @@ describe('Service', function() { 'broadcasts': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Broadcasts' }, 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -160,7 +160,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -200,14 +200,14 @@ describe('Service', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -247,7 +247,7 @@ describe('Service', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -259,7 +259,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -299,14 +299,14 @@ describe('Service', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services.list(); promise.then(function() { @@ -326,7 +326,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -366,7 +366,7 @@ describe('Service', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -381,7 +381,7 @@ describe('Service', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -402,7 +402,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:12:31Z', @@ -429,7 +429,7 @@ describe('Service', function() { 'broadcasts': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Broadcasts' }, 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -444,7 +444,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -465,7 +465,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/messaging/v1/service/alphaSender.spec.js b/spec/integration/rest/messaging/v1/service/alphaSender.spec.js index 110a6489fa..39b6ac27a0 100644 --- a/spec/integration/rest/messaging/v1/service/alphaSender.spec.js +++ b/spec/integration/rest/messaging/v1/service/alphaSender.spec.js @@ -31,7 +31,7 @@ describe('AlphaSender', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {alphaSender: 'alpha_sender'}; var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('AlphaSender', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('AlphaSender', function() { 'SMS' ], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -84,7 +84,7 @@ describe('AlphaSender', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -108,7 +108,7 @@ describe('AlphaSender', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders.each(() => done()); @@ -116,7 +116,7 @@ describe('AlphaSender', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -140,7 +140,7 @@ describe('AlphaSender', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders.each({pageSize: 20}, () => done()); @@ -153,7 +153,7 @@ describe('AlphaSender', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -177,7 +177,7 @@ describe('AlphaSender', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders.each({callback: () => done()}, () => fail('wrong callback!')); @@ -185,7 +185,7 @@ describe('AlphaSender', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders.list(); @@ -207,7 +207,7 @@ describe('AlphaSender', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -231,7 +231,7 @@ describe('AlphaSender', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -247,7 +247,7 @@ describe('AlphaSender', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders('AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -270,7 +270,7 @@ describe('AlphaSender', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -281,7 +281,7 @@ describe('AlphaSender', function() { 'SMS' ], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/AlphaSenders/AIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -297,7 +297,7 @@ describe('AlphaSender', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .alphaSenders('AIXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -320,7 +320,7 @@ describe('AlphaSender', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js b/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js index 9310def7ef..6ef9d7a81f 100644 --- a/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js +++ b/spec/integration/rest/messaging/v1/service/phoneNumber.spec.js @@ -31,7 +31,7 @@ describe('PhoneNumber', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumberSid: 'PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('PhoneNumber', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -66,7 +66,7 @@ describe('PhoneNumber', function() { 'country_code': 'US', 'capabilities': [], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -83,7 +83,7 @@ describe('PhoneNumber', function() { ); it('should generate valid create_with_capabilities response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -97,7 +97,7 @@ describe('PhoneNumber', function() { 'Voice' ], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -114,7 +114,7 @@ describe('PhoneNumber', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -137,7 +137,7 @@ describe('PhoneNumber', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -153,7 +153,7 @@ describe('PhoneNumber', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -176,7 +176,7 @@ describe('PhoneNumber', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each(() => done()); @@ -184,7 +184,7 @@ describe('PhoneNumber', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -207,7 +207,7 @@ describe('PhoneNumber', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({pageSize: 20}, () => done()); @@ -220,7 +220,7 @@ describe('PhoneNumber', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -243,7 +243,7 @@ describe('PhoneNumber', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -251,7 +251,7 @@ describe('PhoneNumber', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.list(); @@ -273,7 +273,7 @@ describe('PhoneNumber', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -296,7 +296,7 @@ describe('PhoneNumber', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -312,7 +312,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -335,7 +335,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -345,7 +345,7 @@ describe('PhoneNumber', function() { 'country_code': 'US', 'capabilities': [], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/messaging/v1/service/shortCode.spec.js b/spec/integration/rest/messaging/v1/service/shortCode.spec.js index 9b6d3e5a6d..9683a572ad 100644 --- a/spec/integration/rest/messaging/v1/service/shortCode.spec.js +++ b/spec/integration/rest/messaging/v1/service/shortCode.spec.js @@ -31,7 +31,7 @@ describe('ShortCode', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {shortCodeSid: 'SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('ShortCode', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('ShortCode', function() { 'SMS' ], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -85,7 +85,7 @@ describe('ShortCode', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -108,7 +108,7 @@ describe('ShortCode', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -124,7 +124,7 @@ describe('ShortCode', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -149,7 +149,7 @@ describe('ShortCode', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each(() => done()); @@ -157,7 +157,7 @@ describe('ShortCode', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -182,7 +182,7 @@ describe('ShortCode', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({pageSize: 20}, () => done()); @@ -195,7 +195,7 @@ describe('ShortCode', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -220,7 +220,7 @@ describe('ShortCode', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -228,7 +228,7 @@ describe('ShortCode', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.list(); @@ -250,7 +250,7 @@ describe('ShortCode', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -275,7 +275,7 @@ describe('ShortCode', function() { 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -291,7 +291,7 @@ describe('ShortCode', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.messaging.v1.services('MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -314,7 +314,7 @@ describe('ShortCode', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -326,7 +326,7 @@ describe('ShortCode', function() { 'SMS' ], 'url': 'https://messaging.twilio.com/v1/Services/MGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/monitor/v1/alert.spec.js b/spec/integration/rest/monitor/v1/alert.spec.js index 44611c2233..877e33e9f2 100644 --- a/spec/integration/rest/monitor/v1/alert.spec.js +++ b/spec/integration/rest/monitor/v1/alert.spec.js @@ -31,7 +31,7 @@ describe('Alert', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.monitor.v1.alerts('NOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Alert', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'alert_text': 'alert_text', 'api_version': '2010-04-01', @@ -72,7 +72,7 @@ describe('Alert', function() { 'sid': 'NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://monitor.twilio.com/v1/Alerts/NOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'PNe2cd757cd5257b0217a447933a0290d2' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Alert', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'alerts': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Alert', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.alerts.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'alerts': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -152,7 +152,7 @@ describe('Alert', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.alerts.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -164,7 +164,7 @@ describe('Alert', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'alerts': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -193,14 +193,14 @@ describe('Alert', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.alerts.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.monitor.v1.alerts.list(); promise.then(function() { @@ -220,7 +220,7 @@ describe('Alert', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'alerts': [], 'meta': { 'first_page_url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0', @@ -231,7 +231,7 @@ describe('Alert', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -246,7 +246,7 @@ describe('Alert', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'alerts': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -275,7 +275,7 @@ describe('Alert', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Alerts?LogLevel=log_level&StartDate=2016-01-01&EndDate=2016-01-01&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/monitor/v1/event.spec.js b/spec/integration/rest/monitor/v1/event.spec.js index dc9b183703..ac26f6d10e 100644 --- a/spec/integration/rest/monitor/v1/event.spec.js +++ b/spec/integration/rest/monitor/v1/event.spec.js @@ -31,7 +31,7 @@ describe('Event', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.monitor.v1.events('AEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Event', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'actor_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'actor_type': 'account', @@ -75,7 +75,7 @@ describe('Event', function() { 'source': 'api', 'source_ip_address': '10.86.6.250', 'url': 'https://monitor.twilio.com/v1/Events/AEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Event', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -126,14 +126,14 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.events.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -169,7 +169,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.events.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -181,7 +181,7 @@ describe('Event', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -217,14 +217,14 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.monitor.v1.events.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.monitor.v1.events.list(); promise.then(function() { @@ -244,7 +244,7 @@ describe('Event', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -280,7 +280,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -295,7 +295,7 @@ describe('Event', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'events': [], 'meta': { 'first_page_url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0', @@ -306,7 +306,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://monitor.twilio.com/v1/Events?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/notify/v1/credential.spec.js b/spec/integration/rest/notify/v1/credential.spec.js index c6aaeff0f7..c407bfc24e 100644 --- a/spec/integration/rest/notify/v1/credential.spec.js +++ b/spec/integration/rest/notify/v1/credential.spec.js @@ -31,7 +31,7 @@ describe('Credential', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -53,14 +53,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.credentials.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -82,7 +82,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.credentials.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -94,7 +94,7 @@ describe('Credential', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -116,14 +116,14 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.credentials.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.credentials.list(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Credential', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [ { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -180,7 +180,7 @@ describe('Credential', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credentials': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Credential', function() { 'next_page_url': null, 'key': 'credentials' } - }); + }; holodeck.mock(new Response(200, body)); @@ -206,7 +206,7 @@ describe('Credential', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {type: 'gcm'}; var promise = client.notify.v1.credentials.create(opts); @@ -229,7 +229,7 @@ describe('Credential', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -238,7 +238,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://notify.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -254,7 +254,7 @@ describe('Credential', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -275,7 +275,7 @@ describe('Credential', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -284,7 +284,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://notify.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Credential', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -320,7 +320,7 @@ describe('Credential', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test slow create', @@ -329,7 +329,7 @@ describe('Credential', function() { 'date_created': '2015-10-07T17:50:01Z', 'date_updated': '2015-10-07T17:50:01Z', 'url': 'https://notify.twilio.com/v1/Credentials/CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -344,7 +344,7 @@ describe('Credential', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.credentials('CRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -365,7 +365,7 @@ describe('Credential', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/notify/v1/service.spec.js b/spec/integration/rest/notify/v1/service.spec.js index 705ba03b28..bfecd8b9da 100644 --- a/spec/integration/rest/notify/v1/service.spec.js +++ b/spec/integration/rest/notify/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services.create(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': '733c7f0f-6541-42ec-84ce-e2ae1cac588c', @@ -78,7 +78,7 @@ describe('Service', function() { 'segments': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments', 'users': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' } - }); + }; holodeck.mock(new Response(201, body)); @@ -93,7 +93,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -114,7 +114,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Service', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -150,7 +150,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': '733c7f0f-6541-42ec-84ce-e2ae1cac588c', @@ -177,7 +177,7 @@ describe('Service', function() { 'segments': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments', 'users': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' } - }); + }; holodeck.mock(new Response(200, body)); @@ -192,7 +192,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -232,14 +232,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -279,7 +279,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -291,7 +291,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -331,14 +331,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services.list(); promise.then(function() { @@ -358,7 +358,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -398,7 +398,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -413,7 +413,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -424,7 +424,7 @@ describe('Service', function() { 'key': 'services' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -439,7 +439,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -460,7 +460,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': '733c7f0f-6541-42ec-84ce-e2ae1cac588c', @@ -487,7 +487,7 @@ describe('Service', function() { 'segments': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Segments', 'users': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/notify/v1/service/binding.spec.js b/spec/integration/rest/notify/v1/service/binding.spec.js index 88820e6d63..d76f26a473 100644 --- a/spec/integration/rest/notify/v1/service/binding.spec.js +++ b/spec/integration/rest/notify/v1/service/binding.spec.js @@ -31,7 +31,7 @@ describe('Binding', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Binding', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address': 'a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73', 'binding_type': 'apn', @@ -73,7 +73,7 @@ describe('Binding', function() { 'user': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039' }, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -89,7 +89,7 @@ describe('Binding', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings('BSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -112,7 +112,7 @@ describe('Binding', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -128,7 +128,7 @@ describe('Binding', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identity: 'identity', bindingType: 'apn', address: 'address'}; var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -153,7 +153,7 @@ describe('Binding', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address': 'a7c658f4111ec4ff5a1a647f9d0edd819025b9f20522d2fae897049f32873e73', 'binding_type': 'apn', @@ -172,7 +172,7 @@ describe('Binding', function() { 'user': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Users/24987039' }, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings/BSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -189,7 +189,7 @@ describe('Binding', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'bindings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -221,7 +221,7 @@ describe('Binding', function() { 'previous_page_url': null, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each(() => done()); @@ -229,7 +229,7 @@ describe('Binding', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'bindings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -261,7 +261,7 @@ describe('Binding', function() { 'previous_page_url': null, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({pageSize: 20}, () => done()); @@ -274,7 +274,7 @@ describe('Binding', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'bindings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -306,7 +306,7 @@ describe('Binding', function() { 'previous_page_url': null, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.each({callback: () => done()}, () => fail('wrong callback!')); @@ -314,7 +314,7 @@ describe('Binding', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .bindings.list(); @@ -336,7 +336,7 @@ describe('Binding', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'bindings': [], 'meta': { 'first_page_url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0', @@ -347,7 +347,7 @@ describe('Binding', function() { 'previous_page_url': null, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -363,7 +363,7 @@ describe('Binding', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'bindings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -395,7 +395,7 @@ describe('Binding', function() { 'previous_page_url': null, 'url': 'https://notify.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Bindings?Tag=tag&Identity=identity&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/notify/v1/service/notification.spec.js b/spec/integration/rest/notify/v1/service/notification.spec.js index 76b268f2b3..5d555b6f10 100644 --- a/spec/integration/rest/notify/v1/service/notification.spec.js +++ b/spec/integration/rest/notify/v1/service/notification.spec.js @@ -31,7 +31,7 @@ describe('Notification', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.notify.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .notifications.create(); @@ -53,7 +53,7 @@ describe('Notification', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'NOb8021351170b4e1286adaac3fdd6d082', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'IS699b53e02da45a1ba9d13b7d7d2766af', @@ -76,7 +76,7 @@ describe('Notification', function() { 'sms': null, 'facebook_messenger': null, 'alexa': null - }); + }; holodeck.mock(new Response(201, body)); @@ -92,7 +92,7 @@ describe('Notification', function() { ); it('should generate valid create_direct_notification response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'NOb8021351170b4e1286adaac3fdd6d082', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'IS699b53e02da45a1ba9d13b7d7d2766af', @@ -113,7 +113,7 @@ describe('Notification', function() { 'sms': null, 'facebook_messenger': null, 'alexa': null - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle.spec.js index 559a5a4dd4..67025635e8 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle.spec.js @@ -31,7 +31,7 @@ describe('Bundle', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', email: 'email'}; var promise = client.numbers.v2.regulatoryCompliance @@ -55,7 +55,7 @@ describe('Bundle', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'regulation_sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('Bundle', function() { 'links': { 'item_assignments': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments' } - }); + }; holodeck.mock(new Response(201, body)); @@ -86,7 +86,7 @@ describe('Bundle', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -113,7 +113,7 @@ describe('Bundle', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles.each(() => done()); @@ -121,7 +121,7 @@ describe('Bundle', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('Bundle', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles.each({pageSize: 20}, () => done()); @@ -161,7 +161,7 @@ describe('Bundle', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('Bundle', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles.each({callback: () => done()}, () => fail('wrong callback!')); @@ -196,7 +196,7 @@ describe('Bundle', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles.list(); @@ -217,7 +217,7 @@ describe('Bundle', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [], 'meta': { 'page': 0, @@ -228,7 +228,7 @@ describe('Bundle', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('Bundle', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -271,7 +271,7 @@ describe('Bundle', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -287,7 +287,7 @@ describe('Bundle', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -309,7 +309,7 @@ describe('Bundle', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'regulation_sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -323,7 +323,7 @@ describe('Bundle', function() { 'links': { 'item_assignments': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments' } - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('Bundle', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -361,7 +361,7 @@ describe('Bundle', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'regulation_sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -375,7 +375,7 @@ describe('Bundle', function() { 'links': { 'item_assignments': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.spec.js index 6aeeaa678c..61590b9cec 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/bundle/itemAssignment.spec.js @@ -31,7 +31,7 @@ describe('ItemAssignment', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {objectSid: 'ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.numbers.v2.regulatoryCompliance @@ -57,14 +57,14 @@ describe('ItemAssignment', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'object_sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2019-07-31T02:34:41Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -82,7 +82,7 @@ describe('ItemAssignment', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -102,7 +102,7 @@ describe('ItemAssignment', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('ItemAssignment', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -131,7 +131,7 @@ describe('ItemAssignment', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -145,7 +145,7 @@ describe('ItemAssignment', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -165,7 +165,7 @@ describe('ItemAssignment', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -174,7 +174,7 @@ describe('ItemAssignment', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -197,7 +197,7 @@ describe('ItemAssignment', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [], 'meta': { 'page': 0, @@ -208,7 +208,7 @@ describe('ItemAssignment', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -225,7 +225,7 @@ describe('ItemAssignment', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -245,7 +245,7 @@ describe('ItemAssignment', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -262,7 +262,7 @@ describe('ItemAssignment', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -286,14 +286,14 @@ describe('ItemAssignment', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bundle_sid': 'BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'object_sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2019-07-31T02:34:41Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Bundles/BUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ItemAssignments/BVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -310,7 +310,7 @@ describe('ItemAssignment', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .bundles('BUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -334,7 +334,7 @@ describe('ItemAssignment', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/endUser.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/endUser.spec.js index 33afaa4084..573715514a 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/endUser.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/endUser.spec.js @@ -31,7 +31,7 @@ describe('EndUser', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'individual'}; var promise = client.numbers.v2.regulatoryCompliance @@ -55,7 +55,7 @@ describe('EndUser', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -66,7 +66,7 @@ describe('EndUser', function() { 'date_created': '2019-07-30T21:57:45Z', 'date_updated': '2019-07-30T21:57:45Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -83,7 +83,7 @@ describe('EndUser', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -107,7 +107,7 @@ describe('EndUser', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUsers.each(() => done()); @@ -115,7 +115,7 @@ describe('EndUser', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -139,7 +139,7 @@ describe('EndUser', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUsers.each({pageSize: 20}, () => done()); @@ -152,7 +152,7 @@ describe('EndUser', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -176,7 +176,7 @@ describe('EndUser', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUsers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -184,7 +184,7 @@ describe('EndUser', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .endUsers.list(); @@ -205,7 +205,7 @@ describe('EndUser', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [], 'meta': { 'page': 0, @@ -216,7 +216,7 @@ describe('EndUser', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -232,7 +232,7 @@ describe('EndUser', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -256,7 +256,7 @@ describe('EndUser', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -272,7 +272,7 @@ describe('EndUser', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -294,7 +294,7 @@ describe('EndUser', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -305,7 +305,7 @@ describe('EndUser', function() { 'date_created': '2019-07-30T21:57:45Z', 'date_updated': '2019-07-30T21:57:45Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -321,7 +321,7 @@ describe('EndUser', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .endUsers('ITXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -343,7 +343,7 @@ describe('EndUser', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -354,7 +354,7 @@ describe('EndUser', function() { 'date_created': '2019-07-30T21:57:45Z', 'date_updated': '2019-07-30T21:57:45Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUsers/ITaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/endUserType.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/endUserType.spec.js index b91cbd7746..82e8f0c861 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/endUserType.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/endUserType.spec.js @@ -31,7 +31,7 @@ describe('EndUserType', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end_user_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -61,7 +61,7 @@ describe('EndUserType', function() { 'next_page_url': null, 'key': 'end_user_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUserTypes.each(() => done()); @@ -69,7 +69,7 @@ describe('EndUserType', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'end_user_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -99,7 +99,7 @@ describe('EndUserType', function() { 'next_page_url': null, 'key': 'end_user_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUserTypes.each({pageSize: 20}, () => done()); @@ -112,7 +112,7 @@ describe('EndUserType', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'end_user_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -142,7 +142,7 @@ describe('EndUserType', function() { 'next_page_url': null, 'key': 'end_user_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .endUserTypes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -150,7 +150,7 @@ describe('EndUserType', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .endUserTypes.list(); @@ -171,7 +171,7 @@ describe('EndUserType', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'end_user_types': [], 'meta': { 'page': 0, @@ -182,7 +182,7 @@ describe('EndUserType', function() { 'next_page_url': null, 'key': 'end_user_types' } - }); + }; holodeck.mock(new Response(200, body)); @@ -198,7 +198,7 @@ describe('EndUserType', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'end_user_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -228,7 +228,7 @@ describe('EndUserType', function() { 'next_page_url': null, 'key': 'end_user_types' } - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('EndUserType', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .endUserTypes('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -266,7 +266,7 @@ describe('EndUserType', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'machine_name': 'machine_name', @@ -283,7 +283,7 @@ describe('EndUserType', function() { } ], 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/EndUserTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/regulation.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/regulation.spec.js index 1575b6d646..1598a1cfa5 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/regulation.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/regulation.spec.js @@ -31,7 +31,7 @@ describe('Regulation', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -81,7 +81,7 @@ describe('Regulation', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .regulations.each(() => done()); @@ -89,7 +89,7 @@ describe('Regulation', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -139,7 +139,7 @@ describe('Regulation', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .regulations.each({pageSize: 20}, () => done()); @@ -152,7 +152,7 @@ describe('Regulation', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -202,7 +202,7 @@ describe('Regulation', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .regulations.each({callback: () => done()}, () => fail('wrong callback!')); @@ -210,7 +210,7 @@ describe('Regulation', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .regulations.list(); @@ -231,7 +231,7 @@ describe('Regulation', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [], 'meta': { 'page': 0, @@ -242,7 +242,7 @@ describe('Regulation', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -258,7 +258,7 @@ describe('Regulation', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -308,7 +308,7 @@ describe('Regulation', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -324,7 +324,7 @@ describe('Regulation', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .regulations('RNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -346,7 +346,7 @@ describe('Regulation', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Australia: Local - Individual', 'iso_country': 'AU', @@ -383,7 +383,7 @@ describe('Regulation', function() { ] }, 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/Regulations/RNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocument.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocument.spec.js index b2f2940150..9476a1f8c7 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocument.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocument.spec.js @@ -31,7 +31,7 @@ describe('SupportingDocument', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', type: 'type'}; var promise = client.numbers.v2.regulatoryCompliance @@ -55,7 +55,7 @@ describe('SupportingDocument', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -69,7 +69,7 @@ describe('SupportingDocument', function() { 'date_created': '2019-07-31T02:11:52Z', 'date_updated': '2019-07-31T02:11:52Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -86,7 +86,7 @@ describe('SupportingDocument', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -113,7 +113,7 @@ describe('SupportingDocument', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocuments.each(() => done()); @@ -121,7 +121,7 @@ describe('SupportingDocument', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('SupportingDocument', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocuments.each({pageSize: 20}, () => done()); @@ -161,7 +161,7 @@ describe('SupportingDocument', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('SupportingDocument', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocuments.each({callback: () => done()}, () => fail('wrong callback!')); @@ -196,7 +196,7 @@ describe('SupportingDocument', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .supportingDocuments.list(); @@ -217,7 +217,7 @@ describe('SupportingDocument', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [], 'meta': { 'page': 0, @@ -228,7 +228,7 @@ describe('SupportingDocument', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('SupportingDocument', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'results': [ { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -271,7 +271,7 @@ describe('SupportingDocument', function() { 'next_page_url': null, 'key': 'results' } - }); + }; holodeck.mock(new Response(200, body)); @@ -287,7 +287,7 @@ describe('SupportingDocument', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .supportingDocuments('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -309,7 +309,7 @@ describe('SupportingDocument', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -323,7 +323,7 @@ describe('SupportingDocument', function() { 'date_created': '2019-07-31T02:11:52Z', 'date_updated': '2019-07-31T02:11:52Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('SupportingDocument', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .supportingDocuments('RDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -361,7 +361,7 @@ describe('SupportingDocument', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -375,7 +375,7 @@ describe('SupportingDocument', function() { 'date_created': '2019-07-31T02:11:52Z', 'date_updated': '2019-07-31T02:11:52Z', 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocuments/RDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.spec.js b/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.spec.js index d185b2bffc..60eb7abab6 100644 --- a/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.spec.js +++ b/spec/integration/rest/numbers/v2/regulatoryCompliance/supportingDocumentType.spec.js @@ -31,7 +31,7 @@ describe('SupportingDocumentType', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'supporting_document_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -56,7 +56,7 @@ describe('SupportingDocumentType', function() { 'next_page_url': null, 'key': 'supporting_document_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocumentTypes.each(() => done()); @@ -64,7 +64,7 @@ describe('SupportingDocumentType', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'supporting_document_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -89,7 +89,7 @@ describe('SupportingDocumentType', function() { 'next_page_url': null, 'key': 'supporting_document_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocumentTypes.each({pageSize: 20}, () => done()); @@ -102,7 +102,7 @@ describe('SupportingDocumentType', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'supporting_document_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -127,7 +127,7 @@ describe('SupportingDocumentType', function() { 'next_page_url': null, 'key': 'supporting_document_types' } - }); + }; holodeck.mock(new Response(200, body)); client.numbers.v2.regulatoryCompliance .supportingDocumentTypes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -135,7 +135,7 @@ describe('SupportingDocumentType', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .supportingDocumentTypes.list(); @@ -156,7 +156,7 @@ describe('SupportingDocumentType', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'supporting_document_types': [], 'meta': { 'page': 0, @@ -167,7 +167,7 @@ describe('SupportingDocumentType', function() { 'next_page_url': null, 'key': 'supporting_document_types' } - }); + }; holodeck.mock(new Response(200, body)); @@ -183,7 +183,7 @@ describe('SupportingDocumentType', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'supporting_document_types': [ { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -208,7 +208,7 @@ describe('SupportingDocumentType', function() { 'next_page_url': null, 'key': 'supporting_document_types' } - }); + }; holodeck.mock(new Response(200, body)); @@ -224,7 +224,7 @@ describe('SupportingDocumentType', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.numbers.v2.regulatoryCompliance .supportingDocumentTypes('OYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -246,7 +246,7 @@ describe('SupportingDocumentType', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Passport', 'machine_name': 'passport', @@ -258,7 +258,7 @@ describe('SupportingDocumentType', function() { } ], 'url': 'https://numbers.twilio.com/v2/RegulatoryCompliance/SupportingDocumentTypes/OYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/bulk_exports/export.spec.js b/spec/integration/rest/preview/bulk_exports/export.spec.js index eb0fafec1f..6e2510076a 100644 --- a/spec/integration/rest/preview/bulk_exports/export.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export.spec.js @@ -31,7 +31,7 @@ describe('Export', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports('resource_type').fetch(); promise.then(function() { @@ -52,13 +52,13 @@ describe('Export', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'resource_type': 'Calls', 'url': 'https://preview.twilio.com/BulkExports/Exports/Calls', 'links': { 'days': 'https://preview.twilio.com/BulkExports/Exports/Calls/Days' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/bulk_exports/export/day.spec.js b/spec/integration/rest/preview/bulk_exports/export/day.spec.js index 82a6d8d7fc..897c97f2b5 100644 --- a/spec/integration/rest/preview/bulk_exports/export/day.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export/day.spec.js @@ -31,7 +31,7 @@ describe('Day', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports('resource_type') .days('day').fetch(); @@ -54,9 +54,9 @@ describe('Day', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'redirect_to': 'https://com.twilio.dev-us1.exports.s3.amazonaws.com/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -72,7 +72,7 @@ describe('Day', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'days': [ { 'day': '2017-04-01', @@ -91,7 +91,7 @@ describe('Day', function() { 'next_page_url': null, 'key': 'days' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .days.each(() => done()); @@ -99,7 +99,7 @@ describe('Day', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'days': [ { 'day': '2017-04-01', @@ -118,7 +118,7 @@ describe('Day', function() { 'next_page_url': null, 'key': 'days' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .days.each({pageSize: 20}, () => done()); @@ -131,7 +131,7 @@ describe('Day', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'days': [ { 'day': '2017-04-01', @@ -150,7 +150,7 @@ describe('Day', function() { 'next_page_url': null, 'key': 'days' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .days.each({callback: () => done()}, () => fail('wrong callback!')); @@ -158,7 +158,7 @@ describe('Day', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports('resource_type') .days.list(); @@ -180,7 +180,7 @@ describe('Day', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'days': [], 'meta': { 'page': 0, @@ -191,7 +191,7 @@ describe('Day', function() { 'next_page_url': null, 'key': 'days' } - }); + }; holodeck.mock(new Response(200, body)); @@ -207,7 +207,7 @@ describe('Day', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'days': [ { 'day': '2017-04-01', @@ -226,7 +226,7 @@ describe('Day', function() { 'next_page_url': null, 'key': 'days' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/bulk_exports/export/exportCustomJob.spec.js b/spec/integration/rest/preview/bulk_exports/export/exportCustomJob.spec.js index eed4d07281..0c6f125e3a 100644 --- a/spec/integration/rest/preview/bulk_exports/export/exportCustomJob.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export/exportCustomJob.spec.js @@ -31,7 +31,7 @@ describe('ExportCustomJob', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'url': 'https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0', @@ -54,7 +54,7 @@ describe('ExportCustomJob', function() { 'resource_type': 'resource_type' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .exportCustomJobs.each(() => done()); @@ -62,7 +62,7 @@ describe('ExportCustomJob', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'url': 'https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0', @@ -85,7 +85,7 @@ describe('ExportCustomJob', function() { 'resource_type': 'resource_type' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .exportCustomJobs.each({pageSize: 20}, () => done()); @@ -98,7 +98,7 @@ describe('ExportCustomJob', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'url': 'https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0', @@ -121,7 +121,7 @@ describe('ExportCustomJob', function() { 'resource_type': 'resource_type' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.bulk_exports.exports('resource_type') .exportCustomJobs.each({callback: () => done()}, () => fail('wrong callback!')); @@ -129,7 +129,7 @@ describe('ExportCustomJob', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports('resource_type') .exportCustomJobs.list(); @@ -151,7 +151,7 @@ describe('ExportCustomJob', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'url': 'https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0', @@ -162,7 +162,7 @@ describe('ExportCustomJob', function() { 'page': 0 }, 'jobs': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -178,7 +178,7 @@ describe('ExportCustomJob', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'url': 'https://preview.twilio.com/BulkExports/Exports/Messages/Jobs?PageSize=50&Page=0', @@ -201,7 +201,7 @@ describe('ExportCustomJob', function() { 'resource_type': 'resource_type' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -217,7 +217,7 @@ describe('ExportCustomJob', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports('resource_type') .exportCustomJobs.create(); @@ -239,7 +239,7 @@ describe('ExportCustomJob', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'start_day': 'start_day', 'job_sid': 'JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', @@ -249,7 +249,7 @@ describe('ExportCustomJob', function() { 'webhook_url': 'webhook_url', 'email': 'email', 'resource_type': 'resource_type' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/bulk_exports/export/job.spec.js b/spec/integration/rest/preview/bulk_exports/export/job.spec.js index b99440364b..6df828434c 100644 --- a/spec/integration/rest/preview/bulk_exports/export/job.spec.js +++ b/spec/integration/rest/preview/bulk_exports/export/job.spec.js @@ -31,7 +31,7 @@ describe('Job', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports .jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -53,7 +53,7 @@ describe('Job', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'start_day': 'start_day', 'job_sid': 'JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/BulkExports/Exports/Jobs/JSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -64,7 +64,7 @@ describe('Job', function() { 'webhook_method': 'webhook_method', 'email': 'email', 'resource_type': 'resource_type' - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Job', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exports .jobs('JSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -102,7 +102,7 @@ describe('Job', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js b/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js index c9c60e9063..8e636e1b6a 100644 --- a/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js +++ b/spec/integration/rest/preview/bulk_exports/exportConfiguration.spec.js @@ -31,7 +31,7 @@ describe('ExportConfiguration', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exportConfiguration('resource_type').fetch(); promise.then(function() { @@ -52,13 +52,13 @@ describe('ExportConfiguration', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/BulkExports/Exports/Calls/Configuration', 'enabled': true, 'webhook_url': '', 'webhook_method': '', 'resource_type': 'Calls' - }); + }; holodeck.mock(new Response(200, body)); @@ -73,7 +73,7 @@ describe('ExportConfiguration', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.bulk_exports.exportConfiguration('resource_type').update(); promise.then(function() { @@ -94,13 +94,13 @@ describe('ExportConfiguration', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/BulkExports/Exports/Calls/Configuration', 'enabled': true, 'webhook_url': '', 'resource_type': 'Calls', 'webhook_method': '' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/deployed_devices/fleet.spec.js b/spec/integration/rest/preview/deployed_devices/fleet.spec.js index b274824cfa..3396426df1 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet.spec.js @@ -31,7 +31,7 @@ describe('Fleet', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Fleet', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -67,7 +67,7 @@ describe('Fleet', function() { 'certificates': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates', 'keys': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys' } - }); + }; holodeck.mock(new Response(200, body)); @@ -82,7 +82,7 @@ describe('Fleet', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -103,7 +103,7 @@ describe('Fleet', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -118,7 +118,7 @@ describe('Fleet', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets.create(); promise.then(function() { @@ -138,7 +138,7 @@ describe('Fleet', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -153,7 +153,7 @@ describe('Fleet', function() { 'certificates': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates', 'keys': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys' } - }); + }; holodeck.mock(new Response(201, body)); @@ -168,7 +168,7 @@ describe('Fleet', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [ { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -196,14 +196,14 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [ { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -231,7 +231,7 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -243,7 +243,7 @@ describe('Fleet', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [ { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -271,14 +271,14 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets.list(); promise.then(function() { @@ -298,7 +298,7 @@ describe('Fleet', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0', @@ -309,7 +309,7 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -324,7 +324,7 @@ describe('Fleet', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [ { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -352,7 +352,7 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -367,7 +367,7 @@ describe('Fleet', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -388,7 +388,7 @@ describe('Fleet', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -403,7 +403,7 @@ describe('Fleet', function() { 'certificates': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates', 'keys': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js index a48ff18378..555feea0dc 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/certificate.spec.js @@ -31,7 +31,7 @@ describe('Certificate', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates('CYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Certificate', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -64,7 +64,7 @@ describe('Certificate', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Certificate', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates('CYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -103,7 +103,7 @@ describe('Certificate', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -119,7 +119,7 @@ describe('Certificate', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {certificateData: 'certificate_data'}; var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -144,7 +144,7 @@ describe('Certificate', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -154,7 +154,7 @@ describe('Certificate', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -171,7 +171,7 @@ describe('Certificate', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'certificates': [ { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -194,7 +194,7 @@ describe('Certificate', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates.each(() => done()); @@ -202,7 +202,7 @@ describe('Certificate', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'certificates': [ { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -225,7 +225,7 @@ describe('Certificate', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates.each({pageSize: 20}, () => done()); @@ -238,7 +238,7 @@ describe('Certificate', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'certificates': [ { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -261,7 +261,7 @@ describe('Certificate', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates.each({callback: () => done()}, () => fail('wrong callback!')); @@ -269,7 +269,7 @@ describe('Certificate', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates.list(); @@ -291,7 +291,7 @@ describe('Certificate', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'certificates': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0', @@ -302,7 +302,7 @@ describe('Certificate', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -318,7 +318,7 @@ describe('Certificate', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'certificates': [ { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -341,7 +341,7 @@ describe('Certificate', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -357,7 +357,7 @@ describe('Certificate', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .certificates('CYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -380,7 +380,7 @@ describe('Certificate', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -390,7 +390,7 @@ describe('Certificate', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': '2016-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Certificates/CYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js index 5100298f63..db0bf3956f 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/deployment.spec.js @@ -31,7 +31,7 @@ describe('Deployment', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments('DLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Deployment', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -63,7 +63,7 @@ describe('Deployment', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': '2016-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -79,7 +79,7 @@ describe('Deployment', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments('DLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -102,7 +102,7 @@ describe('Deployment', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -118,7 +118,7 @@ describe('Deployment', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments.create(); @@ -140,7 +140,7 @@ describe('Deployment', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -149,7 +149,7 @@ describe('Deployment', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': '2016-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -165,7 +165,7 @@ describe('Deployment', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [ { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -187,7 +187,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments.each(() => done()); @@ -195,7 +195,7 @@ describe('Deployment', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [ { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -217,7 +217,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments.each({pageSize: 20}, () => done()); @@ -230,7 +230,7 @@ describe('Deployment', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [ { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -252,7 +252,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments.each({callback: () => done()}, () => fail('wrong callback!')); @@ -260,7 +260,7 @@ describe('Deployment', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments.list(); @@ -282,7 +282,7 @@ describe('Deployment', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0', @@ -293,7 +293,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -309,7 +309,7 @@ describe('Deployment', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [ { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -331,7 +331,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -347,7 +347,7 @@ describe('Deployment', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .deployments('DLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -370,7 +370,7 @@ describe('Deployment', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -379,7 +379,7 @@ describe('Deployment', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': '2016-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Deployments/DLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js index f55541f9ae..0681e44a9b 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/device.spec.js @@ -31,7 +31,7 @@ describe('Device', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices('THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Device', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -67,7 +67,7 @@ describe('Device', function() { 'date_updated': '2016-07-30T20:00:00Z', 'date_authenticated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Device', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices('THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -106,7 +106,7 @@ describe('Device', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -122,7 +122,7 @@ describe('Device', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices.create(); @@ -144,7 +144,7 @@ describe('Device', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -157,7 +157,7 @@ describe('Device', function() { 'date_updated': '2016-07-30T20:00:00Z', 'date_authenticated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -173,7 +173,7 @@ describe('Device', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'devices': [ { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -199,7 +199,7 @@ describe('Device', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices.each(() => done()); @@ -207,7 +207,7 @@ describe('Device', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'devices': [ { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -233,7 +233,7 @@ describe('Device', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices.each({pageSize: 20}, () => done()); @@ -246,7 +246,7 @@ describe('Device', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'devices': [ { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -272,7 +272,7 @@ describe('Device', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices.each({callback: () => done()}, () => fail('wrong callback!')); @@ -280,7 +280,7 @@ describe('Device', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices.list(); @@ -302,7 +302,7 @@ describe('Device', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'devices': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0', @@ -313,7 +313,7 @@ describe('Device', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -329,7 +329,7 @@ describe('Device', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'devices': [ { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -355,7 +355,7 @@ describe('Device', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -371,7 +371,7 @@ describe('Device', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .devices('THXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -394,7 +394,7 @@ describe('Device', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'friendly_name': 'friendly_name', @@ -407,7 +407,7 @@ describe('Device', function() { 'date_updated': '2016-07-30T20:00:00Z', 'date_authenticated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Devices/THaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js b/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js index 0a5cc7ab9c..14f1c482e2 100644 --- a/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js +++ b/spec/integration/rest/preview/deployed_devices/fleet/key.spec.js @@ -31,7 +31,7 @@ describe('Key', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('KYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Key', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -64,7 +64,7 @@ describe('Key', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Key', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('KYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -103,7 +103,7 @@ describe('Key', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -119,7 +119,7 @@ describe('Key', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.create(); @@ -141,7 +141,7 @@ describe('Key', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -151,7 +151,7 @@ describe('Key', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -167,7 +167,7 @@ describe('Key', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -190,7 +190,7 @@ describe('Key', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each(() => done()); @@ -198,7 +198,7 @@ describe('Key', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -221,7 +221,7 @@ describe('Key', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each({pageSize: 20}, () => done()); @@ -234,7 +234,7 @@ describe('Key', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -257,7 +257,7 @@ describe('Key', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.each({callback: () => done()}, () => fail('wrong callback!')); @@ -265,7 +265,7 @@ describe('Key', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys.list(); @@ -287,7 +287,7 @@ describe('Key', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0', @@ -298,7 +298,7 @@ describe('Key', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -314,7 +314,7 @@ describe('Key', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'keys': [ { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -337,7 +337,7 @@ describe('Key', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -353,7 +353,7 @@ describe('Key', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.deployed_devices.fleets('FLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .keys('KYXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -376,7 +376,7 @@ describe('Key', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -386,7 +386,7 @@ describe('Key', function() { 'date_created': '2016-07-30T20:00:00Z', 'date_updated': '2016-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/DeployedDevices/Fleets/FLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Keys/KYaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js b/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js index a1277baf63..342cc171ae 100644 --- a/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js +++ b/spec/integration/rest/preview/hosted_numbers/authorizationDocument.spec.js @@ -33,7 +33,7 @@ describe('AuthorizationDocument', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -54,7 +54,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'address_sid': 'AD11111111111111111111111111111111', 'cc_emails': [ 'aaa@twilio.com', @@ -69,7 +69,7 @@ describe('AuthorizationDocument', function() { 'sid': 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'signing', 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -105,7 +105,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'cc_emails': [ 'test1@twilio.com', @@ -120,7 +120,7 @@ describe('AuthorizationDocument', function() { 'sid': 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'signing', 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -135,7 +135,7 @@ describe('AuthorizationDocument', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0', 'key': 'items', @@ -163,14 +163,14 @@ describe('AuthorizationDocument', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0', 'key': 'items', @@ -198,7 +198,7 @@ describe('AuthorizationDocument', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -210,7 +210,7 @@ describe('AuthorizationDocument', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0', 'key': 'items', @@ -238,14 +238,14 @@ describe('AuthorizationDocument', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.authorizationDocuments.list(); promise.then(function() { @@ -265,7 +265,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0', 'key': 'items', @@ -276,7 +276,7 @@ describe('AuthorizationDocument', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?Status=signed&Email=test%2Bhosted%40twilio.com&PageSize=50&Page=0' }, 'items': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -291,7 +291,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments?PageSize=50&Page=0', 'key': 'items', @@ -319,7 +319,7 @@ describe('AuthorizationDocument', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { hostedNumberOrderSids: ['hosted_number_order_sids'], @@ -369,7 +369,7 @@ describe('AuthorizationDocument', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'address_sid': 'ADaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'cc_emails': [ 'test1@twilio.com', @@ -384,7 +384,7 @@ describe('AuthorizationDocument', function() { 'sid': 'PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'signing', 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.spec.js b/spec/integration/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.spec.js index 207b0d790f..3710664b49 100644 --- a/spec/integration/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.spec.js +++ b/spec/integration/rest/preview/hosted_numbers/authorizationDocument/dependentHostedNumberOrder.spec.js @@ -31,7 +31,7 @@ describe('DependentHostedNumberOrder', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -76,7 +76,7 @@ describe('DependentHostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dependentHostedNumberOrders.each(() => done()); @@ -84,7 +84,7 @@ describe('DependentHostedNumberOrder', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -129,7 +129,7 @@ describe('DependentHostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dependentHostedNumberOrders.each({pageSize: 20}, () => done()); @@ -142,7 +142,7 @@ describe('DependentHostedNumberOrder', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -187,7 +187,7 @@ describe('DependentHostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dependentHostedNumberOrders.each({callback: () => done()}, () => fail('wrong callback!')); @@ -195,7 +195,7 @@ describe('DependentHostedNumberOrder', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.authorizationDocuments('PXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dependentHostedNumberOrders.list(); @@ -217,7 +217,7 @@ describe('DependentHostedNumberOrder', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'key': 'items', @@ -228,7 +228,7 @@ describe('DependentHostedNumberOrder', function() { 'url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' }, 'items': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -244,7 +244,7 @@ describe('DependentHostedNumberOrder', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/AuthorizationDocuments/PXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DependentHostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -289,7 +289,7 @@ describe('DependentHostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js b/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js index be4d6d709e..2ecc0f2eed 100644 --- a/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js +++ b/spec/integration/rest/preview/hosted_numbers/hostedNumberOrder.spec.js @@ -33,7 +33,7 @@ describe('HostedNumberOrder', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.hostedNumberOrders('HRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -54,7 +54,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_sid': 'AD11111111111111111111111111111111', 'call_delay': 15, @@ -87,7 +87,7 @@ describe('HostedNumberOrder', function() { 'verification_code': '8794', 'verification_document_sid': null, 'verification_type': 'phone-call' - }); + }; holodeck.mock(new Response(200, body)); @@ -102,7 +102,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.hostedNumberOrders('HRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -123,7 +123,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -138,7 +138,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.hostedNumberOrders('HRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -159,7 +159,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_sid': 'AD11111111111111111111111111111111', 'call_delay': 15, @@ -192,7 +192,7 @@ describe('HostedNumberOrder', function() { 'verification_code': '8794', 'verification_document_sid': null, 'verification_type': 'phone-call' - }); + }; holodeck.mock(new Response(200, body)); @@ -207,7 +207,7 @@ describe('HostedNumberOrder', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -253,14 +253,14 @@ describe('HostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.hostedNumberOrders.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -306,7 +306,7 @@ describe('HostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.hostedNumberOrders.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -318,7 +318,7 @@ describe('HostedNumberOrder', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -364,14 +364,14 @@ describe('HostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.hosted_numbers.hostedNumberOrders.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.hosted_numbers.hostedNumberOrders.list(); promise.then(function() { @@ -391,7 +391,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&PageSize=50&Page=0', 'key': 'items', @@ -402,7 +402,7 @@ describe('HostedNumberOrder', function() { 'url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?Status=completed&FriendlyName=example&PhoneNumber=%2B19193608000&UniqueName=something123&IncomingPhoneNumberSid=PNzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz&PageSize=50&Page=0' }, 'items': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -417,7 +417,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/HostedNumbers/HostedNumberOrders?PageSize=50&Page=0', 'key': 'items', @@ -463,7 +463,7 @@ describe('HostedNumberOrder', function() { 'verification_type': 'phone-call' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -478,7 +478,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumber: '+15017122661', smsCapability: true}; var promise = client.preview.hosted_numbers.hostedNumberOrders.create(opts); @@ -501,7 +501,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_sid': 'AD11111111111111111111111111111111', 'call_delay': 0, @@ -528,7 +528,7 @@ describe('HostedNumberOrder', function() { 'verification_code': null, 'verification_document_sid': null, 'verification_type': 'phone-call' - }); + }; holodeck.mock(new Response(201, body)); @@ -544,7 +544,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid create_without_optional_loa_fields response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_sid': null, 'call_delay': 0, @@ -571,7 +571,7 @@ describe('HostedNumberOrder', function() { 'verification_code': null, 'verification_document_sid': null, 'verification_type': 'phone-call' - }); + }; holodeck.mock(new Response(201, body)); @@ -587,7 +587,7 @@ describe('HostedNumberOrder', function() { ); it('should generate valid create_with_phone_bill_verification response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'address_sid': null, 'call_delay': 0, @@ -614,7 +614,7 @@ describe('HostedNumberOrder', function() { 'verification_code': null, 'verification_document_sid': 'RIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'verification_type': 'phone-bill' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/marketplace/availableAddOn.spec.js b/spec/integration/rest/preview/marketplace/availableAddOn.spec.js index 9f59a35deb..5908eb07ba 100644 --- a/spec/integration/rest/preview/marketplace/availableAddOn.spec.js +++ b/spec/integration/rest/preview/marketplace/availableAddOn.spec.js @@ -31,7 +31,7 @@ describe('AvailableAddOn', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('AvailableAddOn', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'VoiceBase High Accuracy Transcription', 'description': 'Automatic Transcription and Keyword Extract...', @@ -72,7 +72,7 @@ describe('AvailableAddOn', function() { 'links': { 'extensions': 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('AvailableAddOn', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_add_ons': [ { 'sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -120,14 +120,14 @@ describe('AvailableAddOn', function() { 'next_page_url': null, 'key': 'available_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'available_add_ons': [ { 'sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -160,7 +160,7 @@ describe('AvailableAddOn', function() { 'next_page_url': null, 'key': 'available_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -172,7 +172,7 @@ describe('AvailableAddOn', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'available_add_ons': [ { 'sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -205,14 +205,14 @@ describe('AvailableAddOn', function() { 'next_page_url': null, 'key': 'available_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.availableAddOns.list(); promise.then(function() { @@ -232,7 +232,7 @@ describe('AvailableAddOn', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'available_add_ons': [ { 'sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -265,7 +265,7 @@ describe('AvailableAddOn', function() { 'next_page_url': null, 'key': 'available_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); @@ -280,7 +280,7 @@ describe('AvailableAddOn', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'available_add_ons': [], 'meta': { 'page': 0, @@ -291,7 +291,7 @@ describe('AvailableAddOn', function() { 'next_page_url': null, 'key': 'available_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js b/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js index 27b1ae50ef..f8d7dda552 100644 --- a/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js +++ b/spec/integration/rest/preview/marketplace/availableAddOn/availableAddOnExtension.spec.js @@ -31,7 +31,7 @@ describe('AvailableAddOnExtension', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions('XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,14 +54,14 @@ describe('AvailableAddOnExtension', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'available_add_on_sid': 'XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Incoming Voice Call', 'product_name': 'Programmable Voice', 'unique_name': 'voice-incoming', 'url': 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -77,7 +77,7 @@ describe('AvailableAddOnExtension', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -97,7 +97,7 @@ describe('AvailableAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each(() => done()); @@ -105,7 +105,7 @@ describe('AvailableAddOnExtension', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -125,7 +125,7 @@ describe('AvailableAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each({pageSize: 20}, () => done()); @@ -138,7 +138,7 @@ describe('AvailableAddOnExtension', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -158,7 +158,7 @@ describe('AvailableAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each({callback: () => done()}, () => fail('wrong callback!')); @@ -166,7 +166,7 @@ describe('AvailableAddOnExtension', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.availableAddOns('XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.list(); @@ -188,7 +188,7 @@ describe('AvailableAddOnExtension', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -208,7 +208,7 @@ describe('AvailableAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -224,7 +224,7 @@ describe('AvailableAddOnExtension', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [], 'meta': { 'page': 0, @@ -235,7 +235,7 @@ describe('AvailableAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/marketplace/installedAddOn.spec.js b/spec/integration/rest/preview/marketplace/installedAddOn.spec.js index fb7bc2ad6d..0f1b6946f9 100644 --- a/spec/integration/rest/preview/marketplace/installedAddOn.spec.js +++ b/spec/integration/rest/preview/marketplace/installedAddOn.spec.js @@ -33,7 +33,7 @@ describe('InstalledAddOn', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {availableAddOnSid: 'XBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', acceptTermsOfService: true}; var promise = client.preview.marketplace.installedAddOns.create(opts); @@ -59,7 +59,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'VoiceBase High Accuracy Transcription', @@ -75,7 +75,7 @@ describe('InstalledAddOn', function() { 'extensions': 'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions', 'available_add_on': 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(201, body)); @@ -91,7 +91,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -112,7 +112,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -127,7 +127,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -148,7 +148,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'VoiceBase High Accuracy Transcription', @@ -164,7 +164,7 @@ describe('InstalledAddOn', function() { 'extensions': 'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions', 'available_add_on': 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -179,7 +179,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -200,7 +200,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'VoiceBase High Accuracy Transcription', @@ -216,7 +216,7 @@ describe('InstalledAddOn', function() { 'extensions': 'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions', 'available_add_on': 'https://preview.twilio.com/marketplace/AvailableAddOns/XBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('InstalledAddOn', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'installed_add_ons': [ { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -260,14 +260,14 @@ describe('InstalledAddOn', function() { 'next_page_url': null, 'key': 'installed_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'installed_add_ons': [ { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -296,7 +296,7 @@ describe('InstalledAddOn', function() { 'next_page_url': null, 'key': 'installed_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -308,7 +308,7 @@ describe('InstalledAddOn', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'installed_add_ons': [ { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -337,14 +337,14 @@ describe('InstalledAddOn', function() { 'next_page_url': null, 'key': 'installed_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns.list(); promise.then(function() { @@ -364,7 +364,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'installed_add_ons': [ { 'sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -393,7 +393,7 @@ describe('InstalledAddOn', function() { 'next_page_url': null, 'key': 'installed_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); @@ -408,7 +408,7 @@ describe('InstalledAddOn', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'installed_add_ons': [], 'meta': { 'page': 0, @@ -419,7 +419,7 @@ describe('InstalledAddOn', function() { 'next_page_url': null, 'key': 'installed_add_ons' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js b/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js index 97a0ec6159..c7d57837e7 100644 --- a/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js +++ b/spec/integration/rest/preview/marketplace/installedAddOn/installedAddOnExtension.spec.js @@ -33,7 +33,7 @@ describe('InstalledAddOnExtension', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions('XFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'installed_add_on_sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Incoming Voice Call', @@ -64,7 +64,7 @@ describe('InstalledAddOnExtension', function() { 'unique_name': 'voice-incoming', 'enabled': true, 'url': 'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {enabled: true}; var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -106,7 +106,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'installed_add_on_sid': 'XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Incoming Voice Call', @@ -114,7 +114,7 @@ describe('InstalledAddOnExtension', function() { 'unique_name': 'voice-incoming', 'enabled': false, 'url': 'https://preview.twilio.com/marketplace/InstalledAddOns/XEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Extensions/XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -131,7 +131,7 @@ describe('InstalledAddOnExtension', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -152,7 +152,7 @@ describe('InstalledAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each(() => done()); @@ -160,7 +160,7 @@ describe('InstalledAddOnExtension', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -181,7 +181,7 @@ describe('InstalledAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each({pageSize: 20}, () => done()); @@ -194,7 +194,7 @@ describe('InstalledAddOnExtension', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('InstalledAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.each({callback: () => done()}, () => fail('wrong callback!')); @@ -223,7 +223,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.marketplace.installedAddOns('XEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .extensions.list(); @@ -245,7 +245,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [ { 'sid': 'XFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -266,7 +266,7 @@ describe('InstalledAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -282,7 +282,7 @@ describe('InstalledAddOnExtension', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'extensions': [], 'meta': { 'page': 0, @@ -293,7 +293,7 @@ describe('InstalledAddOnExtension', function() { 'next_page_url': null, 'key': 'extensions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service.spec.js b/spec/integration/rest/preview/sync/service.spec.js index a5473127fe..fa05f19218 100644 --- a/spec/integration/rest/preview/sync/service.spec.js +++ b/spec/integration/rest/preview/sync/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -67,7 +67,7 @@ describe('Service', function() { 'webhook_url': 'http://www.example.com', 'reachability_webhooks_enabled': false, 'acl_enabled': false - }); + }; holodeck.mock(new Response(200, body)); @@ -82,7 +82,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -103,7 +103,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -118,7 +118,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services.create(); promise.then(function() { @@ -138,7 +138,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -153,7 +153,7 @@ describe('Service', function() { 'webhook_url': 'http://www.example.com', 'reachability_webhooks_enabled': false, 'acl_enabled': true - }); + }; holodeck.mock(new Response(201, body)); @@ -168,7 +168,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0', 'key': 'services', @@ -196,14 +196,14 @@ describe('Service', function() { 'acl_enabled': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0', 'key': 'services', @@ -231,7 +231,7 @@ describe('Service', function() { 'acl_enabled': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -243,7 +243,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0', 'key': 'services', @@ -271,14 +271,14 @@ describe('Service', function() { 'acl_enabled': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services.list(); promise.then(function() { @@ -298,7 +298,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0', 'key': 'services', @@ -309,7 +309,7 @@ describe('Service', function() { 'url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -324,7 +324,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services?PageSize=50&Page=0', 'key': 'services', @@ -352,7 +352,7 @@ describe('Service', function() { 'acl_enabled': false } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -367,7 +367,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -388,7 +388,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -403,7 +403,7 @@ describe('Service', function() { 'webhook_url': 'http://www.example.com', 'reachability_webhooks_enabled': false, 'acl_enabled': true - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/document.spec.js b/spec/integration/rest/preview/sync/service/document.spec.js index f7f9d4cd7e..4ef6f11f65 100644 --- a/spec/integration/rest/preview/sync/service/document.spec.js +++ b/spec/integration/rest/preview/sync/service/document.spec.js @@ -33,7 +33,7 @@ describe('Document', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('Document', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -70,7 +70,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Document', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Document', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -128,7 +128,7 @@ describe('Document', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.create(); @@ -150,7 +150,7 @@ describe('Document', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -164,7 +164,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -180,7 +180,7 @@ describe('Document', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -207,7 +207,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each(() => done()); @@ -215,7 +215,7 @@ describe('Document', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -242,7 +242,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each({pageSize: 20}, () => done()); @@ -255,7 +255,7 @@ describe('Document', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -282,7 +282,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each({callback: () => done()}, () => fail('wrong callback!')); @@ -290,7 +290,7 @@ describe('Document', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.list(); @@ -312,7 +312,7 @@ describe('Document', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0', @@ -323,7 +323,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('Document', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -366,7 +366,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -382,7 +382,7 @@ describe('Document', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}, ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -415,7 +415,7 @@ describe('Document', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -429,7 +429,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js b/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js index 3a87394c3c..03f26b9e85 100644 --- a/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/document/documentPermission.spec.js @@ -33,7 +33,7 @@ describe('DocumentPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('DocumentPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'document_sid': 'ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('DocumentPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('DocumentPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('DocumentPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('DocumentPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('DocumentPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('DocumentPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('DocumentPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('DocumentPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('DocumentPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('DocumentPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('DocumentPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'document_sid': 'ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('DocumentPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncList.spec.js b/spec/integration/rest/preview/sync/service/syncList.spec.js index 672e2a835f..dd10a53ed2 100644 --- a/spec/integration/rest/preview/sync/service/syncList.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList.spec.js @@ -31,7 +31,7 @@ describe('SyncList', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('SyncList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_created': '2015-07-30T20:00:00Z', @@ -68,7 +68,7 @@ describe('SyncList', function() { 'sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -107,7 +107,7 @@ describe('SyncList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -123,7 +123,7 @@ describe('SyncList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.create(); @@ -145,7 +145,7 @@ describe('SyncList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_created': '2015-07-30T20:00:00Z', @@ -159,7 +159,7 @@ describe('SyncList', function() { 'sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -175,7 +175,7 @@ describe('SyncList', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -202,7 +202,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each(() => done()); @@ -210,7 +210,7 @@ describe('SyncList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -237,7 +237,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each({pageSize: 20}, () => done()); @@ -250,7 +250,7 @@ describe('SyncList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -277,7 +277,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each({callback: () => done()}, () => fail('wrong callback!')); @@ -285,7 +285,7 @@ describe('SyncList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.list(); @@ -307,7 +307,7 @@ describe('SyncList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0', @@ -318,7 +318,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('SyncList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -361,7 +361,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js b/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js index 9dc42910a9..95fd421efc 100644 --- a/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList/syncListItem.spec.js @@ -33,7 +33,7 @@ describe('SyncListItem', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncListItem', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -69,7 +69,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('SyncListItem', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -114,7 +114,7 @@ describe('SyncListItem', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -131,7 +131,7 @@ describe('SyncListItem', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -158,7 +158,7 @@ describe('SyncListItem', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -169,7 +169,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('SyncListItem', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -211,7 +211,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -220,7 +220,7 @@ describe('SyncListItem', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -244,7 +244,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -258,7 +258,7 @@ describe('SyncListItem', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -282,7 +282,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -291,7 +291,7 @@ describe('SyncListItem', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -315,7 +315,7 @@ describe('SyncListItem', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0', @@ -326,7 +326,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('SyncListItem', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -367,7 +367,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -384,7 +384,7 @@ describe('SyncListItem', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}, ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('SyncListItem', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -430,7 +430,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js b/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js index 2b01ee979c..7183fa26ad 100644 --- a/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/syncList/syncListPermission.spec.js @@ -33,7 +33,7 @@ describe('SyncListPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncListPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'list_sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('SyncListPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncListPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('SyncListPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('SyncListPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('SyncListPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('SyncListPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('SyncListPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('SyncListPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('SyncListPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('SyncListPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('SyncListPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'list_sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('SyncListPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncMap.spec.js b/spec/integration/rest/preview/sync/service/syncMap.spec.js index aa75e6a7fe..76eda31e9c 100644 --- a/spec/integration/rest/preview/sync/service/syncMap.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap.spec.js @@ -31,7 +31,7 @@ describe('SyncMap', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('SyncMap', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_created': '2015-07-30T20:00:00Z', @@ -68,7 +68,7 @@ describe('SyncMap', function() { 'sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncMap', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -107,7 +107,7 @@ describe('SyncMap', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -123,7 +123,7 @@ describe('SyncMap', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.create(); @@ -145,7 +145,7 @@ describe('SyncMap', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_created': '2015-07-30T20:00:00Z', @@ -159,7 +159,7 @@ describe('SyncMap', function() { 'sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -175,7 +175,7 @@ describe('SyncMap', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -202,7 +202,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each(() => done()); @@ -210,7 +210,7 @@ describe('SyncMap', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -237,7 +237,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each({pageSize: 20}, () => done()); @@ -250,7 +250,7 @@ describe('SyncMap', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -277,7 +277,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each({callback: () => done()}, () => fail('wrong callback!')); @@ -285,7 +285,7 @@ describe('SyncMap', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.list(); @@ -307,7 +307,7 @@ describe('SyncMap', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0', @@ -318,7 +318,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -334,7 +334,7 @@ describe('SyncMap', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -361,7 +361,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js b/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js index 8f20cfc3e1..19851b7c44 100644 --- a/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap/syncMapItem.spec.js @@ -33,7 +33,7 @@ describe('SyncMapItem', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncMapItem', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -69,7 +69,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('SyncMapItem', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -114,7 +114,7 @@ describe('SyncMapItem', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -131,7 +131,7 @@ describe('SyncMapItem', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {key: 'key', data: {}}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -158,7 +158,7 @@ describe('SyncMapItem', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -169,7 +169,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(201, body)); @@ -187,7 +187,7 @@ describe('SyncMapItem', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -211,7 +211,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -220,7 +220,7 @@ describe('SyncMapItem', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -244,7 +244,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -258,7 +258,7 @@ describe('SyncMapItem', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -282,7 +282,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -291,7 +291,7 @@ describe('SyncMapItem', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -315,7 +315,7 @@ describe('SyncMapItem', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0', @@ -326,7 +326,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('SyncMapItem', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -367,7 +367,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -384,7 +384,7 @@ describe('SyncMapItem', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}, ifMatch: 'if_match'}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -419,7 +419,7 @@ describe('SyncMapItem', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -430,7 +430,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js b/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js index f35aeaa63d..bc461c7611 100644 --- a/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js +++ b/spec/integration/rest/preview/sync/service/syncMap/syncMapPermission.spec.js @@ -33,7 +33,7 @@ describe('SyncMapPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'map_sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('SyncMapPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('SyncMapPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('SyncMapPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('SyncMapPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.preview.sync.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'map_sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('SyncMapPermission', function() { 'write': true, 'manage': true, 'url': 'https://preview.twilio.com/Sync/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/trusted_comms/brandedCall.spec.js b/spec/integration/rest/preview/trusted_comms/brandedCall.spec.js index 2550ef31aa..b5692bd60e 100644 --- a/spec/integration/rest/preview/trusted_comms/brandedCall.spec.js +++ b/spec/integration/rest/preview/trusted_comms/brandedCall.spec.js @@ -31,7 +31,7 @@ describe('BrandedCall', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {from: 'from', to: 'to', reason: 'reason'}; var promise = client.preview.trusted_comms.brandedCalls.create(opts); @@ -54,7 +54,7 @@ describe('BrandedCall', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bg_color': '#fff', 'brand_sid': 'BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -73,7 +73,7 @@ describe('BrandedCall', function() { 'to': '+573000000000', 'use_case': 'conversational', 'url': 'https://preview.twilio.com/TrustedComms/Business/BrandedCalls' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/trusted_comms/business.spec.js b/spec/integration/rest/preview/trusted_comms/business.spec.js index 7356ed37e3..a6a15bca04 100644 --- a/spec/integration/rest/preview/trusted_comms/business.spec.js +++ b/spec/integration/rest/preview/trusted_comms/business.spec.js @@ -31,7 +31,7 @@ describe('Business', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,14 +52,14 @@ describe('Business', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'links': { 'insights': 'https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/trusted_comms/business/insights/successRate.spec.js b/spec/integration/rest/preview/trusted_comms/business/insights/successRate.spec.js index 8817eb0f09..67bce277b6 100644 --- a/spec/integration/rest/preview/trusted_comms/business/insights/successRate.spec.js +++ b/spec/integration/rest/preview/trusted_comms/business/insights/successRate.spec.js @@ -31,7 +31,7 @@ describe('SuccessRate', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.trusted_comms.businesses('BXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .insights @@ -54,7 +54,7 @@ describe('SuccessRate', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'business_sid': 'BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'start': '2015-07-30T20:00:00Z', @@ -69,7 +69,7 @@ describe('SuccessRate', function() { } }, 'url': 'https://preview.twilio.com/TrustedComms/Businesses/BXaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Insights/SuccessRate' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/trusted_comms/cps.spec.js b/spec/integration/rest/preview/trusted_comms/cps.spec.js index b1b8b19881..c7a6dba028 100644 --- a/spec/integration/rest/preview/trusted_comms/cps.spec.js +++ b/spec/integration/rest/preview/trusted_comms/cps.spec.js @@ -31,7 +31,7 @@ describe('Cps', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {xXcnamSensitivePhoneNumber: 'x_xcnam_sensitive_phone_number'}; var promise = client.preview.trusted_comms.cps().fetch(opts); @@ -54,11 +54,11 @@ describe('Cps', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'cps_url': 'https://preview.twilio.com/TrustedComms/CurrentCall', 'phone_number': '+1500123', 'url': 'https://preview.twilio.com/TrustedComms/CPS' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/trusted_comms/currentCall.spec.js b/spec/integration/rest/preview/trusted_comms/currentCall.spec.js index ec0ec5adf4..d8eaba27e8 100644 --- a/spec/integration/rest/preview/trusted_comms/currentCall.spec.js +++ b/spec/integration/rest/preview/trusted_comms/currentCall.spec.js @@ -31,7 +31,7 @@ describe('CurrentCall', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { xXcnamSensitivePhoneNumberFrom: 'x_xcnam_sensitive_phone_number_from', @@ -60,7 +60,7 @@ describe('CurrentCall', function() { ); it('should generate valid read_found response', function(done) { - var body = JSON.stringify({ + var body = { 'bg_color': '#fff', 'caller': 'Owl Bank', 'created_at': '2019-05-01T20:00:00Z', @@ -75,7 +75,7 @@ describe('CurrentCall', function() { 'to': '+1500456', 'url': 'https://preview.twilio.com/TrustedComms/CurrentCall', 'use_case': 'conversational' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/trusted_comms/phoneCall.spec.js b/spec/integration/rest/preview/trusted_comms/phoneCall.spec.js index 568b7d5950..ea0303f989 100644 --- a/spec/integration/rest/preview/trusted_comms/phoneCall.spec.js +++ b/spec/integration/rest/preview/trusted_comms/phoneCall.spec.js @@ -31,7 +31,7 @@ describe('PhoneCall', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {from: 'from', to: 'to'}; var promise = client.preview.trusted_comms.phoneCalls.create(opts); @@ -54,7 +54,7 @@ describe('PhoneCall', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'bg_color': '#fff', 'brand_sid': 'BZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -73,7 +73,7 @@ describe('PhoneCall', function() { 'to': '+573000000000', 'url': 'https://preview.twilio.com/TrustedComms/Business/PhoneCalls', 'use_case': 'conversational' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/understand/assistant.spec.js b/spec/integration/rest/preview/understand/assistant.spec.js index 50e1a714a3..4859e66725 100644 --- a/spec/integration/rest/preview/understand/assistant.spec.js +++ b/spec/integration/rest/preview/understand/assistant.spec.js @@ -31,7 +31,7 @@ describe('Assistant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Assistant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -74,7 +74,7 @@ describe('Assistant', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(200, body)); @@ -89,7 +89,7 @@ describe('Assistant', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -124,14 +124,14 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -166,7 +166,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -178,7 +178,7 @@ describe('Assistant', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -213,14 +213,14 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants.list(); promise.then(function() { @@ -240,7 +240,7 @@ describe('Assistant', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0', @@ -251,7 +251,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -266,7 +266,7 @@ describe('Assistant', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'assistants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -301,7 +301,7 @@ describe('Assistant', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -316,7 +316,7 @@ describe('Assistant', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants.create(); promise.then(function() { @@ -336,7 +336,7 @@ describe('Assistant', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -358,7 +358,7 @@ describe('Assistant', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(201, body)); @@ -373,7 +373,7 @@ describe('Assistant', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -394,7 +394,7 @@ describe('Assistant', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-04T08:34:00Z', 'date_updated': '2017-07-04T08:34:00Z', @@ -416,7 +416,7 @@ describe('Assistant', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'callback_url': 'https://example.com/callback_url', 'callback_events': 'model_build_completed model_build_failed' - }); + }; holodeck.mock(new Response(200, body)); @@ -431,7 +431,7 @@ describe('Assistant', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -452,7 +452,7 @@ describe('Assistant', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js b/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js index c9034c2f21..a8bc7913f1 100644 --- a/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js +++ b/spec/integration/rest/preview/understand/assistant/assistantFallbackActions.spec.js @@ -31,7 +31,7 @@ describe('AssistantFallbackActions', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assistantFallbackActions().fetch(); @@ -53,12 +53,12 @@ describe('AssistantFallbackActions', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); @@ -74,7 +74,7 @@ describe('AssistantFallbackActions', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assistantFallbackActions().update(); @@ -96,12 +96,12 @@ describe('AssistantFallbackActions', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FallbackActions', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js b/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js index 8192dcdd76..133a4f49e0 100644 --- a/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js +++ b/spec/integration/rest/preview/understand/assistant/assistantInitiationActions.spec.js @@ -31,7 +31,7 @@ describe('AssistantInitiationActions', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assistantInitiationActions().fetch(); @@ -53,12 +53,12 @@ describe('AssistantInitiationActions', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': {}, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions' - }); + }; holodeck.mock(new Response(200, body)); @@ -74,7 +74,7 @@ describe('AssistantInitiationActions', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assistantInitiationActions().update(); @@ -96,12 +96,12 @@ describe('AssistantInitiationActions', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/InitiationActions', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/understand/assistant/dialogue.spec.js b/spec/integration/rest/preview/understand/assistant/dialogue.spec.js index b12ba7916b..37795976c7 100644 --- a/spec/integration/rest/preview/understand/assistant/dialogue.spec.js +++ b/spec/integration/rest/preview/understand/assistant/dialogue.spec.js @@ -31,7 +31,7 @@ describe('Dialogue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dialogues('UKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,13 +54,13 @@ describe('Dialogue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UKkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Dialogues/UKkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/understand/assistant/fieldType.spec.js b/spec/integration/rest/preview/understand/assistant/fieldType.spec.js index d4d5cea803..e4c5796e05 100644 --- a/spec/integration/rest/preview/understand/assistant/fieldType.spec.js +++ b/spec/integration/rest/preview/understand/assistant/fieldType.spec.js @@ -31,7 +31,7 @@ describe('FieldType', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('FieldType', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -66,7 +66,7 @@ describe('FieldType', function() { 'field_values': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -82,7 +82,7 @@ describe('FieldType', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -107,7 +107,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each(() => done()); @@ -115,7 +115,7 @@ describe('FieldType', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -140,7 +140,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each({pageSize: 20}, () => done()); @@ -153,7 +153,7 @@ describe('FieldType', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -178,7 +178,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -186,7 +186,7 @@ describe('FieldType', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes.list(); @@ -208,7 +208,7 @@ describe('FieldType', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -219,7 +219,7 @@ describe('FieldType', function() { 'key': 'field_types' }, 'field_types': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -235,7 +235,7 @@ describe('FieldType', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes?PageSize=50&Page=0', @@ -260,7 +260,7 @@ describe('FieldType', function() { 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('FieldType', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -301,7 +301,7 @@ describe('FieldType', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -313,7 +313,7 @@ describe('FieldType', function() { 'field_values': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -330,7 +330,7 @@ describe('FieldType', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -353,7 +353,7 @@ describe('FieldType', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -365,7 +365,7 @@ describe('FieldType', function() { 'field_values': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues' }, 'sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -381,7 +381,7 @@ describe('FieldType', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -404,7 +404,7 @@ describe('FieldType', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/fieldType/fieldValue.spec.js b/spec/integration/rest/preview/understand/assistant/fieldType/fieldValue.spec.js index 854acaf9c6..ad1901a887 100644 --- a/spec/integration/rest/preview/understand/assistant/fieldType/fieldValue.spec.js +++ b/spec/integration/rest/preview/understand/assistant/fieldType/fieldValue.spec.js @@ -31,7 +31,7 @@ describe('FieldValue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('FieldValue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type_sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('FieldValue', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'synonym_of': null - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('FieldValue', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('FieldValue', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -141,7 +141,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('FieldValue', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -188,7 +188,7 @@ describe('FieldValue', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -212,7 +212,7 @@ describe('FieldValue', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0', @@ -223,7 +223,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -240,7 +240,7 @@ describe('FieldValue', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'field_values': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -264,7 +264,7 @@ describe('FieldValue', function() { 'next_page_url': null, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues?Language=language&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -281,7 +281,7 @@ describe('FieldValue', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', value: 'value'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -308,7 +308,7 @@ describe('FieldValue', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldTypes/UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/FieldValues/UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type_sid': 'UBaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -319,7 +319,7 @@ describe('FieldValue', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'synonym_of': 'UCbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb' - }); + }; holodeck.mock(new Response(201, body)); @@ -337,7 +337,7 @@ describe('FieldValue', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .fieldTypes('UBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('FieldValue', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/modelBuild.spec.js b/spec/integration/rest/preview/understand/assistant/modelBuild.spec.js index 2ba59e14b9..1e6b4ea115 100644 --- a/spec/integration/rest/preview/understand/assistant/modelBuild.spec.js +++ b/spec/integration/rest/preview/understand/assistant/modelBuild.spec.js @@ -31,7 +31,7 @@ describe('ModelBuild', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('ModelBuild', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -65,7 +65,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': null, 'error_code': null - }); + }; holodeck.mock(new Response(200, body)); @@ -81,7 +81,7 @@ describe('ModelBuild', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -105,7 +105,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each(() => done()); @@ -113,7 +113,7 @@ describe('ModelBuild', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -137,7 +137,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each({pageSize: 20}, () => done()); @@ -150,7 +150,7 @@ describe('ModelBuild', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -174,7 +174,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.each({callback: () => done()}, () => fail('wrong callback!')); @@ -182,7 +182,7 @@ describe('ModelBuild', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.list(); @@ -204,7 +204,7 @@ describe('ModelBuild', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -215,7 +215,7 @@ describe('ModelBuild', function() { 'page_size': 50 }, 'model_builds': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('ModelBuild', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'key': 'model_builds', @@ -255,7 +255,7 @@ describe('ModelBuild', function() { 'error_code': 23001 } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -271,7 +271,7 @@ describe('ModelBuild', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds.create(); @@ -293,7 +293,7 @@ describe('ModelBuild', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -304,7 +304,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': null, 'error_code': null - }); + }; holodeck.mock(new Response(201, body)); @@ -320,7 +320,7 @@ describe('ModelBuild', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -343,7 +343,7 @@ describe('ModelBuild', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ModelBuilds/UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -354,7 +354,7 @@ describe('ModelBuild', function() { 'unique_name': 'unique_name', 'build_duration': 100, 'error_code': null - }); + }; holodeck.mock(new Response(200, body)); @@ -370,7 +370,7 @@ describe('ModelBuild', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .modelBuilds('UGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -393,7 +393,7 @@ describe('ModelBuild', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/query.spec.js b/spec/integration/rest/preview/understand/assistant/query.spec.js index c7c60c7aac..83fd1a2ce7 100644 --- a/spec/integration/rest/preview/understand/assistant/query.spec.js +++ b/spec/integration/rest/preview/understand/assistant/query.spec.js @@ -31,7 +31,7 @@ describe('Query', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Query', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -81,7 +81,7 @@ describe('Query', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'voice' - }); + }; holodeck.mock(new Response(200, body)); @@ -97,7 +97,7 @@ describe('Query', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -137,7 +137,7 @@ describe('Query', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each(() => done()); @@ -145,7 +145,7 @@ describe('Query', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -185,7 +185,7 @@ describe('Query', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each({pageSize: 20}, () => done()); @@ -198,7 +198,7 @@ describe('Query', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -238,7 +238,7 @@ describe('Query', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -246,7 +246,7 @@ describe('Query', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries.list(); @@ -268,7 +268,7 @@ describe('Query', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [], 'meta': { 'previous_page_url': null, @@ -279,7 +279,7 @@ describe('Query', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -295,7 +295,7 @@ describe('Query', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'queries': [ { 'language': 'language', @@ -335,7 +335,7 @@ describe('Query', function() { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Queries?Status=status&ModelBuild=UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Language=language&PageSize=50&Page=0', 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -351,7 +351,7 @@ describe('Query', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', query: 'query'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -376,7 +376,7 @@ describe('Query', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -403,7 +403,7 @@ describe('Query', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'voice' - }); + }; holodeck.mock(new Response(201, body)); @@ -420,7 +420,7 @@ describe('Query', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -443,7 +443,7 @@ describe('Query', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'language': 'language', 'date_created': '2015-07-30T20:00:00Z', 'model_build_sid': 'UGaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -470,7 +470,7 @@ describe('Query', function() { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UHaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'source_channel': 'sms' - }); + }; holodeck.mock(new Response(200, body)); @@ -486,7 +486,7 @@ describe('Query', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .queries('UHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -509,7 +509,7 @@ describe('Query', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/styleSheet.spec.js b/spec/integration/rest/preview/understand/assistant/styleSheet.spec.js index 436041d987..a66135f201 100644 --- a/spec/integration/rest/preview/understand/assistant/styleSheet.spec.js +++ b/spec/integration/rest/preview/understand/assistant/styleSheet.spec.js @@ -31,7 +31,7 @@ describe('StyleSheet', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .styleSheet().fetch(); @@ -53,12 +53,12 @@ describe('StyleSheet', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': {}, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet' - }); + }; holodeck.mock(new Response(200, body)); @@ -74,7 +74,7 @@ describe('StyleSheet', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .styleSheet().update(); @@ -96,12 +96,12 @@ describe('StyleSheet', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/StyleSheet', 'data': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/understand/assistant/task.spec.js b/spec/integration/rest/preview/understand/assistant/task.spec.js index 2f1d5ad91e..332c2ec2b7 100644 --- a/spec/integration/rest/preview/understand/assistant/task.spec.js +++ b/spec/integration/rest/preview/understand/assistant/task.spec.js @@ -31,7 +31,7 @@ describe('Task', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Task', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -70,7 +70,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Task', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -115,7 +115,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each(() => done()); @@ -123,7 +123,7 @@ describe('Task', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -152,7 +152,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({pageSize: 20}, () => done()); @@ -165,7 +165,7 @@ describe('Task', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -194,7 +194,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({callback: () => done()}, () => fail('wrong callback!')); @@ -202,7 +202,7 @@ describe('Task', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.list(); @@ -224,7 +224,7 @@ describe('Task', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -235,7 +235,7 @@ describe('Task', function() { 'previous_page_url': null }, 'tasks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -251,7 +251,7 @@ describe('Task', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'key': 'tasks', 'page_size': 50, @@ -280,7 +280,7 @@ describe('Task', function() { 'actions_url': 'https://example.com/actions_url' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('Task', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -321,7 +321,7 @@ describe('Task', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -337,7 +337,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(201, body)); @@ -354,7 +354,7 @@ describe('Task', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -377,7 +377,7 @@ describe('Task', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'unique_name': 'unique_name', 'links': { 'fields': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields', @@ -393,7 +393,7 @@ describe('Task', function() { 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'actions_url': 'https://example.com/actions_url' - }); + }; holodeck.mock(new Response(200, body)); @@ -409,7 +409,7 @@ describe('Task', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -432,7 +432,7 @@ describe('Task', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/task/field.spec.js b/spec/integration/rest/preview/understand/assistant/task/field.spec.js index 30db44270e..cfe646f143 100644 --- a/spec/integration/rest/preview/understand/assistant/task/field.spec.js +++ b/spec/integration/rest/preview/understand/assistant/task/field.spec.js @@ -31,7 +31,7 @@ describe('Field', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Field', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', @@ -66,7 +66,7 @@ describe('Field', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type': 'field_type' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Field', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -106,7 +106,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -115,7 +115,7 @@ describe('Field', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -138,7 +138,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -152,7 +152,7 @@ describe('Field', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -175,7 +175,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -184,7 +184,7 @@ describe('Field', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -208,7 +208,7 @@ describe('Field', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [], 'meta': { 'page': 0, @@ -219,7 +219,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -236,7 +236,7 @@ describe('Field', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'fields': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -259,7 +259,7 @@ describe('Field', function() { 'previous_page_url': null, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('Field', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {fieldType: 'field_type', uniqueName: 'unique_name'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -303,7 +303,7 @@ describe('Field', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Fields/UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', @@ -313,7 +313,7 @@ describe('Field', function() { 'date_created': '2015-07-30T20:00:00Z', 'sid': 'UEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'field_type': 'field_type' - }); + }; holodeck.mock(new Response(201, body)); @@ -331,7 +331,7 @@ describe('Field', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -356,7 +356,7 @@ describe('Field', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/task/sample.spec.js b/spec/integration/rest/preview/understand/assistant/task/sample.spec.js index 3c93b05ee2..971848d759 100644 --- a/spec/integration/rest/preview/understand/assistant/task/sample.spec.js +++ b/spec/integration/rest/preview/understand/assistant/task/sample.spec.js @@ -31,7 +31,7 @@ describe('Sample', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Sample', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': null - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('Sample', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -108,7 +108,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Sample', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -141,7 +141,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('Sample', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -188,7 +188,7 @@ describe('Sample', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -212,7 +212,7 @@ describe('Sample', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples?Language=language&PageSize=50&Page=0', @@ -223,7 +223,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -240,7 +240,7 @@ describe('Sample', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'samples': [ { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -264,7 +264,7 @@ describe('Sample', function() { 'page': 0, 'page_size': 50 } - }); + }; holodeck.mock(new Response(200, body)); @@ -281,7 +281,7 @@ describe('Sample', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {language: 'language', taggedText: 'tagged_text'}; var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -308,7 +308,7 @@ describe('Sample', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -319,7 +319,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': 'alexa' - }); + }; holodeck.mock(new Response(201, body)); @@ -337,7 +337,7 @@ describe('Sample', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -362,7 +362,7 @@ describe('Sample', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Samples/UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'UFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -373,7 +373,7 @@ describe('Sample', function() { 'tagged_text': 'tagged_text', 'date_updated': '2015-07-30T20:00:00Z', 'source_channel': 'alexa' - }); + }; holodeck.mock(new Response(200, body)); @@ -390,7 +390,7 @@ describe('Sample', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -415,7 +415,7 @@ describe('Sample', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/understand/assistant/task/taskActions.spec.js b/spec/integration/rest/preview/understand/assistant/task/taskActions.spec.js index 599e3c9432..792e7fe5e2 100644 --- a/spec/integration/rest/preview/understand/assistant/task/taskActions.spec.js +++ b/spec/integration/rest/preview/understand/assistant/task/taskActions.spec.js @@ -31,7 +31,7 @@ describe('TaskActions', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,13 +55,13 @@ describe('TaskActions', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDdddddddddddddddddddddddddddddddd', 'data': {}, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDdddddddddddddddddddddddddddddddd/Actions' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('TaskActions', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -102,13 +102,13 @@ describe('TaskActions', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDdddddddddddddddddddddddddddddddd', 'data': {}, 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDdddddddddddddddddddddddddddddddd/Actions' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/understand/assistant/task/taskStatistics.spec.js b/spec/integration/rest/preview/understand/assistant/task/taskStatistics.spec.js index 183dccf14e..253ecab951 100644 --- a/spec/integration/rest/preview/understand/assistant/task/taskStatistics.spec.js +++ b/spec/integration/rest/preview/understand/assistant/task/taskStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.understand.assistants('UAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('UDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,14 +55,14 @@ describe('TaskStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://preview.twilio.com/understand/Assistants/UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assistant_sid': 'UAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'task_sid': 'UDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'samples_count': 0, 'fields_count': 0 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/wireless/command.spec.js b/spec/integration/rest/preview/wireless/command.spec.js index 8fbc605740..b9c959bd2e 100644 --- a/spec/integration/rest/preview/wireless/command.spec.js +++ b/spec/integration/rest/preview/wireless/command.spec.js @@ -31,7 +31,7 @@ describe('Command', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.commands('DCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Command', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'command_mode', @@ -64,7 +64,7 @@ describe('Command', function() { 'sid': 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'status', 'url': 'https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -79,7 +79,7 @@ describe('Command', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -104,14 +104,14 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.commands.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -136,7 +136,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.commands.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -148,7 +148,7 @@ describe('Command', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -173,14 +173,14 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.commands.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.commands.list(); promise.then(function() { @@ -200,7 +200,7 @@ describe('Command', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0', @@ -211,7 +211,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -226,7 +226,7 @@ describe('Command', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Commands?Device=device&Status=status&Direction=direction&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -266,7 +266,7 @@ describe('Command', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {command: 'command'}; var promise = client.preview.wireless.commands.create(opts); @@ -289,7 +289,7 @@ describe('Command', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'command_mode', @@ -301,7 +301,7 @@ describe('Command', function() { 'sid': 'DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'status', 'url': 'https://preview.twilio.com/wireless/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/preview/wireless/ratePlan.spec.js b/spec/integration/rest/preview/wireless/ratePlan.spec.js index 0feb9922ef..3dac078662 100644 --- a/spec/integration/rest/preview/wireless/ratePlan.spec.js +++ b/spec/integration/rest/preview/wireless/ratePlan.spec.js @@ -31,7 +31,7 @@ describe('RatePlan', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -63,14 +63,14 @@ describe('RatePlan', function() { 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.ratePlans.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -102,7 +102,7 @@ describe('RatePlan', function() { 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.ratePlans.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -114,7 +114,7 @@ describe('RatePlan', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -146,14 +146,14 @@ describe('RatePlan', function() { 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.ratePlans.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.ratePlans.list(); promise.then(function() { @@ -173,7 +173,7 @@ describe('RatePlan', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -184,7 +184,7 @@ describe('RatePlan', function() { 'url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0' }, 'rate_plans': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -199,7 +199,7 @@ describe('RatePlan', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -231,7 +231,7 @@ describe('RatePlan', function() { 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -246,7 +246,7 @@ describe('RatePlan', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -267,7 +267,7 @@ describe('RatePlan', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -286,7 +286,7 @@ describe('RatePlan', function() { ], 'sid': 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('RatePlan', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.ratePlans.create(); promise.then(function() { @@ -321,7 +321,7 @@ describe('RatePlan', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -340,7 +340,7 @@ describe('RatePlan', function() { ], 'sid': 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -355,7 +355,7 @@ describe('RatePlan', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -376,7 +376,7 @@ describe('RatePlan', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -395,7 +395,7 @@ describe('RatePlan', function() { ], 'sid': 'WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://preview.twilio.com/wireless/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -410,7 +410,7 @@ describe('RatePlan', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -431,7 +431,7 @@ describe('RatePlan', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/preview/wireless/sim.spec.js b/spec/integration/rest/preview/wireless/sim.spec.js index 12f3150178..50b8bc1860 100644 --- a/spec/integration/rest/preview/wireless/sim.spec.js +++ b/spec/integration/rest/preview/wireless/sim.spec.js @@ -31,7 +31,7 @@ describe('Sim', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Sim', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -78,7 +78,7 @@ describe('Sim', function() { 'e_id': 'e_id', 'status': 'status', 'url': 'https://preview.twilio.com/wireless/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -93,7 +93,7 @@ describe('Sim', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -132,14 +132,14 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.sims.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -178,7 +178,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.sims.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -190,7 +190,7 @@ describe('Sim', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -229,14 +229,14 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.preview.wireless.sims.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.sims.list(); promise.then(function() { @@ -256,7 +256,7 @@ describe('Sim', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [], 'meta': { 'first_page_url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0', @@ -267,7 +267,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -282,7 +282,7 @@ describe('Sim', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -321,7 +321,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://preview.twilio.com/wireless/Sims?Status=status&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -336,7 +336,7 @@ describe('Sim', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -357,7 +357,7 @@ describe('Sim', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -383,7 +383,7 @@ describe('Sim', function() { 'voice_method': 'http_method', 'voice_url': 'http://www.example.com', 'url': 'https://preview.twilio.com/wireless/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/preview/wireless/sim/usage.spec.js b/spec/integration/rest/preview/wireless/sim/usage.spec.js index ccf3637bd2..f88506c10b 100644 --- a/spec/integration/rest/preview/wireless/sim/usage.spec.js +++ b/spec/integration/rest/preview/wireless/sim/usage.spec.js @@ -31,7 +31,7 @@ describe('Usage', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.preview.wireless.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usage().fetch(); @@ -53,7 +53,7 @@ describe('Usage', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'commands_costs': {}, 'commands_usage': {}, @@ -63,7 +63,7 @@ describe('Usage', function() { 'sim_sid': 'DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'period': {}, 'url': 'https://preview.twilio.com/wireless/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Usage' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v1/messaging/country.spec.js b/spec/integration/rest/pricing/v1/messaging/country.spec.js index 9ff6fd77a8..0576caabdb 100644 --- a/spec/integration/rest/pricing/v1/messaging/country.spec.js +++ b/spec/integration/rest/pricing/v1/messaging/country.spec.js @@ -31,7 +31,7 @@ describe('Country', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'country', @@ -48,7 +48,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.messaging .countries.each(() => done()); @@ -56,7 +56,7 @@ describe('Country', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'country', @@ -73,7 +73,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.messaging .countries.each({pageSize: 20}, () => done()); @@ -86,7 +86,7 @@ describe('Country', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'country', @@ -103,7 +103,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.messaging .countries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -111,7 +111,7 @@ describe('Country', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.messaging .countries.list(); @@ -132,7 +132,7 @@ describe('Country', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [], 'meta': { 'first_page_url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0', @@ -143,7 +143,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -159,7 +159,7 @@ describe('Country', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'country', @@ -176,7 +176,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Messaging/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -192,7 +192,7 @@ describe('Country', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.messaging .countries('US').fetch(); @@ -214,7 +214,7 @@ describe('Country', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'country', 'inbound_sms_prices': [ { @@ -240,7 +240,7 @@ describe('Country', function() { ], 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v1/Messaging/Countries/US' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js b/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js index 7d5673e00e..4a79917baf 100644 --- a/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js +++ b/spec/integration/rest/pricing/v1/phoneNumber/country.spec.js @@ -31,7 +31,7 @@ describe('Country', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Austria', @@ -48,7 +48,7 @@ describe('Country', function() { 'next_page_url': null, 'key': 'countries' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.phoneNumbers .countries.each(() => done()); @@ -56,7 +56,7 @@ describe('Country', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Austria', @@ -73,7 +73,7 @@ describe('Country', function() { 'next_page_url': null, 'key': 'countries' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.phoneNumbers .countries.each({pageSize: 20}, () => done()); @@ -86,7 +86,7 @@ describe('Country', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Austria', @@ -103,7 +103,7 @@ describe('Country', function() { 'next_page_url': null, 'key': 'countries' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.phoneNumbers .countries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -111,7 +111,7 @@ describe('Country', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.phoneNumbers .countries.list(); @@ -132,7 +132,7 @@ describe('Country', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Austria', @@ -149,7 +149,7 @@ describe('Country', function() { 'next_page_url': null, 'key': 'countries' } - }); + }; holodeck.mock(new Response(200, body)); @@ -165,7 +165,7 @@ describe('Country', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [], 'meta': { 'first_page_url': 'https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0', @@ -176,7 +176,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/PhoneNumbers/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -192,7 +192,7 @@ describe('Country', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.phoneNumbers .countries('US').fetch(); @@ -214,7 +214,7 @@ describe('Country', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'United States', 'iso_country': 'US', 'phone_number_prices': [ @@ -231,7 +231,7 @@ describe('Country', function() { ], 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v1/PhoneNumbers/Countries/US' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v1/voice/country.spec.js b/spec/integration/rest/pricing/v1/voice/country.spec.js index 99a36900ba..401439b0c0 100644 --- a/spec/integration/rest/pricing/v1/voice/country.spec.js +++ b/spec/integration/rest/pricing/v1/voice/country.spec.js @@ -31,7 +31,7 @@ describe('Country', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -48,7 +48,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.voice .countries.each(() => done()); @@ -56,7 +56,7 @@ describe('Country', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -73,7 +73,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.voice .countries.each({pageSize: 20}, () => done()); @@ -86,7 +86,7 @@ describe('Country', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -103,7 +103,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v1.voice .countries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -111,7 +111,7 @@ describe('Country', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.voice .countries.list(); @@ -132,7 +132,7 @@ describe('Country', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -149,7 +149,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -165,7 +165,7 @@ describe('Country', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [], 'meta': { 'first_page_url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0', @@ -176,7 +176,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v1/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -192,7 +192,7 @@ describe('Country', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.voice .countries('US').fetch(); @@ -214,7 +214,7 @@ describe('Country', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'United States', 'inbound_call_prices': [ { @@ -241,7 +241,7 @@ describe('Country', function() { ], 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v1/Voice/Countries/US' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v1/voice/number.spec.js b/spec/integration/rest/pricing/v1/voice/number.spec.js index 91e1449119..23f999f0f4 100644 --- a/spec/integration/rest/pricing/v1/voice/number.spec.js +++ b/spec/integration/rest/pricing/v1/voice/number.spec.js @@ -31,7 +31,7 @@ describe('Number', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v1.voice .numbers('+15017122661').fetch(); @@ -53,7 +53,7 @@ describe('Number', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'Iran', 'inbound_call_price': { 'base_price': null, @@ -68,7 +68,7 @@ describe('Number', function() { }, 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v1/Voice/Numbers/+987654321' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v2/voice/country.spec.js b/spec/integration/rest/pricing/v2/voice/country.spec.js index 8b4e3c697f..2a286a336e 100644 --- a/spec/integration/rest/pricing/v2/voice/country.spec.js +++ b/spec/integration/rest/pricing/v2/voice/country.spec.js @@ -31,7 +31,7 @@ describe('Country', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -48,7 +48,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v2.voice .countries.each(() => done()); @@ -56,7 +56,7 @@ describe('Country', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -73,7 +73,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v2.voice .countries.each({pageSize: 20}, () => done()); @@ -86,7 +86,7 @@ describe('Country', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -103,7 +103,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.pricing.v2.voice .countries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -111,7 +111,7 @@ describe('Country', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v2.voice .countries.list(); @@ -132,7 +132,7 @@ describe('Country', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [ { 'country': 'Andorra', @@ -149,7 +149,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -165,7 +165,7 @@ describe('Country', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'countries': [], 'meta': { 'first_page_url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0', @@ -176,7 +176,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://pricing.twilio.com/v2/Voice/Countries?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -192,7 +192,7 @@ describe('Country', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v2.voice .countries('US').fetch(); @@ -214,7 +214,7 @@ describe('Country', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'United States', 'inbound_call_prices': [ { @@ -282,7 +282,7 @@ describe('Country', function() { ], 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v2/Voice/Countries/US' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/pricing/v2/voice/number.spec.js b/spec/integration/rest/pricing/v2/voice/number.spec.js index 98e5eacdc8..422d33f135 100644 --- a/spec/integration/rest/pricing/v2/voice/number.spec.js +++ b/spec/integration/rest/pricing/v2/voice/number.spec.js @@ -31,7 +31,7 @@ describe('Number', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.pricing.v2.voice .numbers('+15017122661').fetch(); @@ -53,7 +53,7 @@ describe('Number', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'country': 'United States', 'destination_number': '+18001234567', 'inbound_call_price': { @@ -74,7 +74,7 @@ describe('Number', function() { ], 'price_unit': 'USD', 'url': 'https://pricing.twilio.com/v2/Voice/Numbers/+18001234567' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/proxy/v1/service.spec.js b/spec/integration/rest/proxy/v1/service.spec.js index 4d62767f77..779bf7aa4e 100644 --- a/spec/integration/rest/proxy/v1/service.spec.js +++ b/spec/integration/rest/proxy/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_instance_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -71,7 +71,7 @@ describe('Service', function() { 'phone_numbers': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'short_codes': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' } - }); + }; holodeck.mock(new Response(200, body)); @@ -86,7 +86,7 @@ describe('Service', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services.list(); promise.then(function() { @@ -106,7 +106,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'services': [], 'meta': { 'first_page_url': 'https://proxy.twilio.com/v1/Services?PageSize=50&Page=0', @@ -117,7 +117,7 @@ describe('Service', function() { 'previous_page_url': null, 'url': 'https://proxy.twilio.com/v1/Services?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -132,7 +132,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.proxy.v1.services.create(opts); @@ -155,7 +155,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_instance_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -174,7 +174,7 @@ describe('Service', function() { 'phone_numbers': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'short_codes': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' } - }); + }; holodeck.mock(new Response(201, body)); @@ -190,7 +190,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -211,7 +211,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -226,7 +226,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -247,7 +247,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'chat_instance_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -266,7 +266,7 @@ describe('Service', function() { 'phone_numbers': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'short_codes': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js b/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js index 8e83d2d7a0..4b5fc7905c 100644 --- a/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js +++ b/spec/integration/rest/proxy/v1/service/phoneNumber.spec.js @@ -31,7 +31,7 @@ describe('PhoneNumber', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.create(); @@ -53,7 +53,7 @@ describe('PhoneNumber', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -69,7 +69,7 @@ describe('PhoneNumber', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': false, 'in_use': 0 - }); + }; holodeck.mock(new Response(201, body)); @@ -85,7 +85,7 @@ describe('PhoneNumber', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -108,7 +108,7 @@ describe('PhoneNumber', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -124,7 +124,7 @@ describe('PhoneNumber', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -153,7 +153,7 @@ describe('PhoneNumber', function() { 'in_use': 0 } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each(() => done()); @@ -161,7 +161,7 @@ describe('PhoneNumber', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -190,7 +190,7 @@ describe('PhoneNumber', function() { 'in_use': 0 } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({pageSize: 20}, () => done()); @@ -203,7 +203,7 @@ describe('PhoneNumber', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -232,7 +232,7 @@ describe('PhoneNumber', function() { 'in_use': 0 } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -240,7 +240,7 @@ describe('PhoneNumber', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.list(); @@ -262,7 +262,7 @@ describe('PhoneNumber', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -291,7 +291,7 @@ describe('PhoneNumber', function() { 'in_use': 0 } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -307,7 +307,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -330,7 +330,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -346,7 +346,7 @@ describe('PhoneNumber', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': false, 'in_use': 0 - }); + }; holodeck.mock(new Response(200, body)); @@ -362,7 +362,7 @@ describe('PhoneNumber', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -385,7 +385,7 @@ describe('PhoneNumber', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -401,7 +401,7 @@ describe('PhoneNumber', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': true, 'in_use': 0 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/proxy/v1/service/session.spec.js b/spec/integration/rest/proxy/v1/service/session.spec.js index 5ab3cd4543..0587601835 100644 --- a/spec/integration/rest/proxy/v1/service/session.spec.js +++ b/spec/integration/rest/proxy/v1/service/session.spec.js @@ -31,7 +31,7 @@ describe('Session', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Session', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'open', 'unique_name': 'Order #1234', @@ -74,7 +74,7 @@ describe('Session', function() { 'interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions', 'participants': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' } - }); + }; holodeck.mock(new Response(200, body)); @@ -90,7 +90,7 @@ describe('Session', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions.list(); @@ -112,7 +112,7 @@ describe('Session', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'sessions': [], 'meta': { 'previous_page_url': null, @@ -123,7 +123,7 @@ describe('Session', function() { 'page_size': 50, 'key': 'sessions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -139,7 +139,7 @@ describe('Session', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions.create(); @@ -161,7 +161,7 @@ describe('Session', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'open', 'unique_name': 'Order #1234', @@ -181,7 +181,7 @@ describe('Session', function() { 'interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions', 'participants': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' } - }); + }; holodeck.mock(new Response(201, body)); @@ -197,7 +197,7 @@ describe('Session', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -220,7 +220,7 @@ describe('Session', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -236,7 +236,7 @@ describe('Session', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -259,7 +259,7 @@ describe('Session', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'in-progress', 'unique_name': 'Order #1234', @@ -279,7 +279,7 @@ describe('Session', function() { 'interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions', 'participants': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/proxy/v1/service/session/interaction.spec.js b/spec/integration/rest/proxy/v1/service/session/interaction.spec.js index 889a6b0485..623a829aa9 100644 --- a/spec/integration/rest/proxy/v1/service/session/interaction.spec.js +++ b/spec/integration/rest/proxy/v1/service/session/interaction.spec.js @@ -31,7 +31,7 @@ describe('Interaction', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Interaction', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': '{\'body\':\'some message\'}', 'date_created': '2015-07-30T20:00:00Z', @@ -76,7 +76,7 @@ describe('Interaction', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Interactions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -93,7 +93,7 @@ describe('Interaction', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -117,7 +117,7 @@ describe('Interaction', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'interactions': [], 'meta': { 'previous_page_url': null, @@ -128,7 +128,7 @@ describe('Interaction', function() { 'page_size': 50, 'key': 'interactions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -145,7 +145,7 @@ describe('Interaction', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -170,7 +170,7 @@ describe('Interaction', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/proxy/v1/service/session/participant.spec.js b/spec/integration/rest/proxy/v1/service/session/participant.spec.js index 0e1d11b363..6d06abea6c 100644 --- a/spec/integration/rest/proxy/v1/service/session/participant.spec.js +++ b/spec/integration/rest/proxy/v1/service/session/participant.spec.js @@ -31,7 +31,7 @@ describe('Participant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Participant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -72,7 +72,7 @@ describe('Participant', function() { 'links': { 'message_interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -89,7 +89,7 @@ describe('Participant', function() { ); it('should generate valid fetch_channel response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -105,7 +105,7 @@ describe('Participant', function() { 'links': { 'message_interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -122,7 +122,7 @@ describe('Participant', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -146,7 +146,7 @@ describe('Participant', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -157,7 +157,7 @@ describe('Participant', function() { 'key': 'participants' }, 'participants': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -174,7 +174,7 @@ describe('Participant', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {identifier: 'identifier'}; var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -201,7 +201,7 @@ describe('Participant', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -217,7 +217,7 @@ describe('Participant', function() { 'links': { 'message_interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -235,7 +235,7 @@ describe('Participant', function() { ); it('should generate valid create_channel response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('Participant', function() { 'links': { 'message_interactions': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -269,7 +269,7 @@ describe('Participant', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -294,7 +294,7 @@ describe('Participant', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/proxy/v1/service/session/participant/messageInteraction.spec.js b/spec/integration/rest/proxy/v1/service/session/participant/messageInteraction.spec.js index 18e080682e..9c466613da 100644 --- a/spec/integration/rest/proxy/v1/service/session/participant/messageInteraction.spec.js +++ b/spec/integration/rest/proxy/v1/service/session/participant/messageInteraction.spec.js @@ -31,7 +31,7 @@ describe('MessageInteraction', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -57,7 +57,7 @@ describe('MessageInteraction', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': '{\'body\':\'some message\'}', 'date_created': '2015-07-30T20:00:00Z', @@ -78,7 +78,7 @@ describe('MessageInteraction', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -96,7 +96,7 @@ describe('MessageInteraction', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -123,7 +123,7 @@ describe('MessageInteraction', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': '{\'body\':\'some message\'}', 'date_created': '2015-07-30T20:00:00Z', @@ -144,7 +144,7 @@ describe('MessageInteraction', function() { 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Sessions/KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/KPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessageInteractions/KIaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'session_sid': 'KCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -162,7 +162,7 @@ describe('MessageInteraction', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .sessions('KCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -188,7 +188,7 @@ describe('MessageInteraction', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'interactions': [], 'meta': { 'previous_page_url': null, @@ -199,7 +199,7 @@ describe('MessageInteraction', function() { 'page_size': 50, 'key': 'interactions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/proxy/v1/service/shortCode.spec.js b/spec/integration/rest/proxy/v1/service/shortCode.spec.js index 8911584749..3e72e2cfce 100644 --- a/spec/integration/rest/proxy/v1/service/shortCode.spec.js +++ b/spec/integration/rest/proxy/v1/service/shortCode.spec.js @@ -31,7 +31,7 @@ describe('ShortCode', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {sid: 'SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('ShortCode', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -70,7 +70,7 @@ describe('ShortCode', function() { }, 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': false - }); + }; holodeck.mock(new Response(201, body)); @@ -87,7 +87,7 @@ describe('ShortCode', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -110,7 +110,7 @@ describe('ShortCode', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('ShortCode', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -153,7 +153,7 @@ describe('ShortCode', function() { 'is_reserved': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each(() => done()); @@ -161,7 +161,7 @@ describe('ShortCode', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -188,7 +188,7 @@ describe('ShortCode', function() { 'is_reserved': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({pageSize: 20}, () => done()); @@ -201,7 +201,7 @@ describe('ShortCode', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -228,7 +228,7 @@ describe('ShortCode', function() { 'is_reserved': false } ] - }); + }; holodeck.mock(new Response(200, body)); client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.each({callback: () => done()}, () => fail('wrong callback!')); @@ -236,7 +236,7 @@ describe('ShortCode', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes.list(); @@ -258,7 +258,7 @@ describe('ShortCode', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -285,7 +285,7 @@ describe('ShortCode', function() { 'is_reserved': false } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('ShortCode', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -324,7 +324,7 @@ describe('ShortCode', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -338,7 +338,7 @@ describe('ShortCode', function() { }, 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': false - }); + }; holodeck.mock(new Response(200, body)); @@ -354,7 +354,7 @@ describe('ShortCode', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.proxy.v1.services('KSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .shortCodes('SCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -377,7 +377,7 @@ describe('ShortCode', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -391,7 +391,7 @@ describe('ShortCode', function() { }, 'url': 'https://proxy.twilio.com/v1/Services/KSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/ShortCodes/SCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'is_reserved': true - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service.spec.js b/spec/integration/rest/serverless/v1/service.spec.js index 81c28d39b6..ce4c3f6c45 100644 --- a/spec/integration/rest/serverless/v1/service.spec.js +++ b/spec/integration/rest/serverless/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services.list(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'services': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services?PageSize=50&Page=0', @@ -62,7 +62,7 @@ describe('Service', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -77,7 +77,7 @@ describe('Service', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -98,7 +98,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZS00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'test-service', @@ -114,7 +114,7 @@ describe('Service', function() { 'assets': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets', 'builds': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds' } - }); + }; holodeck.mock(new Response(200, body)); @@ -129,7 +129,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -150,7 +150,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -165,7 +165,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name', friendlyName: 'friendly_name'}; var promise = client.serverless.v1.services.create(opts); @@ -188,7 +188,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZS00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'service-friendly', @@ -204,7 +204,7 @@ describe('Service', function() { 'assets': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets', 'builds': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds' } - }); + }; holodeck.mock(new Response(201, body)); @@ -220,7 +220,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -241,7 +241,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZS00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'service-friendly-update', @@ -257,7 +257,7 @@ describe('Service', function() { 'assets': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets', 'builds': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service/asset.spec.js b/spec/integration/rest/serverless/v1/service/asset.spec.js index 93df105c6a..b369400204 100644 --- a/spec/integration/rest/serverless/v1/service/asset.spec.js +++ b/spec/integration/rest/serverless/v1/service/asset.spec.js @@ -31,7 +31,7 @@ describe('Asset', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assets.list(); @@ -53,7 +53,7 @@ describe('Asset', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'assets': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets?PageSize=50&Page=0', @@ -64,7 +64,7 @@ describe('Asset', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Asset', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Asset', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -114,7 +114,7 @@ describe('Asset', function() { 'links': { 'asset_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -130,7 +130,7 @@ describe('Asset', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -153,7 +153,7 @@ describe('Asset', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -169,7 +169,7 @@ describe('Asset', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -194,7 +194,7 @@ describe('Asset', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -205,7 +205,7 @@ describe('Asset', function() { 'links': { 'asset_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -222,7 +222,7 @@ describe('Asset', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('Asset', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -259,7 +259,7 @@ describe('Asset', function() { 'links': { 'asset_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service/asset/assetVersion.spec.js b/spec/integration/rest/serverless/v1/service/asset/assetVersion.spec.js index b801c19ec0..46ea4cc068 100644 --- a/spec/integration/rest/serverless/v1/service/asset/assetVersion.spec.js +++ b/spec/integration/rest/serverless/v1/service/asset/assetVersion.spec.js @@ -31,7 +31,7 @@ describe('AssetVersion', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('AssetVersion', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'asset_versions': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions?PageSize=50&Page=0', @@ -66,7 +66,7 @@ describe('AssetVersion', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('AssetVersion', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .assets('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('AssetVersion', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZN00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -117,7 +117,7 @@ describe('AssetVersion', function() { 'visibility': 'public', 'date_created': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Assets/ZH00000000000000000000000000000000/Versions/ZN00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service/build.spec.js b/spec/integration/rest/serverless/v1/service/build.spec.js index 6f239b1f76..df19a14be2 100644 --- a/spec/integration/rest/serverless/v1/service/build.spec.js +++ b/spec/integration/rest/serverless/v1/service/build.spec.js @@ -31,7 +31,7 @@ describe('Build', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .builds.list(); @@ -53,7 +53,7 @@ describe('Build', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'builds': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds?PageSize=50&Page=0', @@ -64,7 +64,7 @@ describe('Build', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Build', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .builds('ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Build', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZB00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -139,7 +139,7 @@ describe('Build', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds/ZB00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); @@ -155,7 +155,7 @@ describe('Build', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .builds('ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -178,7 +178,7 @@ describe('Build', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -194,7 +194,7 @@ describe('Build', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .builds.create(); @@ -216,7 +216,7 @@ describe('Build', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZB00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -252,7 +252,7 @@ describe('Build', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Builds/ZB00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/serverless/v1/service/environment.spec.js b/spec/integration/rest/serverless/v1/service/environment.spec.js index f08114fc5f..85a01021a7 100644 --- a/spec/integration/rest/serverless/v1/service/environment.spec.js +++ b/spec/integration/rest/serverless/v1/service/environment.spec.js @@ -31,7 +31,7 @@ describe('Environment', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments.list(); @@ -53,7 +53,7 @@ describe('Environment', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'environments': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments?PageSize=50&Page=0', @@ -64,7 +64,7 @@ describe('Environment', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Environment', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Environment', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZE00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -119,7 +119,7 @@ describe('Environment', function() { 'deployments': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments', 'logs': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Logs' } - }); + }; holodeck.mock(new Response(200, body)); @@ -135,7 +135,7 @@ describe('Environment', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -160,7 +160,7 @@ describe('Environment', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZE00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -176,7 +176,7 @@ describe('Environment', function() { 'deployments': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments', 'logs': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Logs' } - }); + }; holodeck.mock(new Response(201, body)); @@ -193,7 +193,7 @@ describe('Environment', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -216,7 +216,7 @@ describe('Environment', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/serverless/v1/service/environment/deployment.spec.js b/spec/integration/rest/serverless/v1/service/environment/deployment.spec.js index 80fe26e9cb..dfb03a264b 100644 --- a/spec/integration/rest/serverless/v1/service/environment/deployment.spec.js +++ b/spec/integration/rest/serverless/v1/service/environment/deployment.spec.js @@ -31,7 +31,7 @@ describe('Deployment', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('Deployment', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'deployments': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0', @@ -66,7 +66,7 @@ describe('Deployment', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Deployment', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('Deployment', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZD00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -117,7 +117,7 @@ describe('Deployment', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); @@ -134,7 +134,7 @@ describe('Deployment', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {buildSid: 'ZBXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -161,7 +161,7 @@ describe('Deployment', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZD00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -170,7 +170,7 @@ describe('Deployment', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Deployments/ZD00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/serverless/v1/service/environment/log.spec.js b/spec/integration/rest/serverless/v1/service/environment/log.spec.js index 807456d08d..bb4c169ba0 100644 --- a/spec/integration/rest/serverless/v1/service/environment/log.spec.js +++ b/spec/integration/rest/serverless/v1/service/environment/log.spec.js @@ -31,7 +31,7 @@ describe('Log', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('Log', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'logs': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Logs?StartDate=2018-11-10T20%3A00%3A00Z&EndDate=2018-12-10T20%3A00%3A00Z&FunctionSid=ZH00000000000000000000000000000000&PageSize=50&Page=0', @@ -66,7 +66,7 @@ describe('Log', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Logs?StartDate=2018-11-10T20%3A00%3A00Z&EndDate=2018-12-10T20%3A00%3A00Z&FunctionSid=ZH00000000000000000000000000000000&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Log', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('Log', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'NO00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -120,7 +120,7 @@ describe('Log', function() { 'message': 'This is a warning', 'date_created': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Logs/NO00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service/environment/variable.spec.js b/spec/integration/rest/serverless/v1/service/environment/variable.spec.js index 989fe478c4..68c8fd0e6e 100644 --- a/spec/integration/rest/serverless/v1/service/environment/variable.spec.js +++ b/spec/integration/rest/serverless/v1/service/environment/variable.spec.js @@ -31,7 +31,7 @@ describe('Variable', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('Variable', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'variables': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables?PageSize=50&Page=0', @@ -66,7 +66,7 @@ describe('Variable', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Variable', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('Variable', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZV00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -118,7 +118,7 @@ describe('Variable', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables/ZV00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); @@ -135,7 +135,7 @@ describe('Variable', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {key: 'key', value: 'value'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -162,7 +162,7 @@ describe('Variable', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZV00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -172,7 +172,7 @@ describe('Variable', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables/ZV00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(201, body)); @@ -190,7 +190,7 @@ describe('Variable', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -215,7 +215,7 @@ describe('Variable', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZV00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -225,7 +225,7 @@ describe('Variable', function() { 'date_created': '2018-11-10T20:00:00Z', 'date_updated': '2018-11-11T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Environments/ZE00000000000000000000000000000000/Variables/ZV00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); @@ -242,7 +242,7 @@ describe('Variable', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .environments('ZEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -267,7 +267,7 @@ describe('Variable', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/serverless/v1/service/function.spec.js b/spec/integration/rest/serverless/v1/service/function.spec.js index 15923d43be..9586d5dc7c 100644 --- a/spec/integration/rest/serverless/v1/service/function.spec.js +++ b/spec/integration/rest/serverless/v1/service/function.spec.js @@ -31,7 +31,7 @@ describe('Function', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .functions.list(); @@ -53,7 +53,7 @@ describe('Function', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'functions': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions?PageSize=50&Page=0', @@ -64,7 +64,7 @@ describe('Function', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Function', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .functions('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Function', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -114,7 +114,7 @@ describe('Function', function() { 'links': { 'function_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -130,7 +130,7 @@ describe('Function', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .functions('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -153,7 +153,7 @@ describe('Function', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -169,7 +169,7 @@ describe('Function', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -194,7 +194,7 @@ describe('Function', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -205,7 +205,7 @@ describe('Function', function() { 'links': { 'function_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -222,7 +222,7 @@ describe('Function', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('Function', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZH00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -259,7 +259,7 @@ describe('Function', function() { 'links': { 'function_versions': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/serverless/v1/service/function/functionVersion.spec.js b/spec/integration/rest/serverless/v1/service/function/functionVersion.spec.js index 83896a9041..94c73cb975 100644 --- a/spec/integration/rest/serverless/v1/service/function/functionVersion.spec.js +++ b/spec/integration/rest/serverless/v1/service/function/functionVersion.spec.js @@ -31,7 +31,7 @@ describe('FunctionVersion', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .functions('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('FunctionVersion', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'function_versions': [], 'meta': { 'first_page_url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions?PageSize=50&Page=0', @@ -66,7 +66,7 @@ describe('FunctionVersion', function() { 'previous_page_url': null, 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('FunctionVersion', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.serverless.v1.services('ZSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .functions('ZHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('FunctionVersion', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'ZN00000000000000000000000000000000', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ZS00000000000000000000000000000000', @@ -117,7 +117,7 @@ describe('FunctionVersion', function() { 'visibility': 'public', 'date_created': '2018-11-10T20:00:00Z', 'url': 'https://serverless.twilio.com/v1/Services/ZS00000000000000000000000000000000/Functions/ZH00000000000000000000000000000000/Versions/ZN00000000000000000000000000000000' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow.spec.js b/spec/integration/rest/studio/v1/flow.spec.js index caeac47044..0bfe264306 100644 --- a/spec/integration/rest/studio/v1/flow.spec.js +++ b/spec/integration/rest/studio/v1/flow.spec.js @@ -31,7 +31,7 @@ describe('Flow', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows.list(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Flow', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -62,7 +62,7 @@ describe('Flow', function() { 'key': 'flows' }, 'flows': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -77,7 +77,7 @@ describe('Flow', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -98,7 +98,7 @@ describe('Flow', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test Flow', @@ -111,7 +111,7 @@ describe('Flow', function() { 'engagements': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements', 'executions': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -126,7 +126,7 @@ describe('Flow', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -147,7 +147,7 @@ describe('Flow', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement.spec.js b/spec/integration/rest/studio/v1/flow/engagement.spec.js index 791b232c24..3815097887 100644 --- a/spec/integration/rest/studio/v1/flow/engagement.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement.spec.js @@ -31,7 +31,7 @@ describe('Engagement', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements.list(); @@ -53,7 +53,7 @@ describe('Engagement', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -64,7 +64,7 @@ describe('Engagement', function() { 'key': 'engagements' }, 'engagements': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Engagement', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Engagement', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -118,7 +118,7 @@ describe('Engagement', function() { 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'engagement_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); @@ -134,7 +134,7 @@ describe('Engagement', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: '+15558675310', from: '+15017122661'}; var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('Engagement', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -174,7 +174,7 @@ describe('Engagement', function() { 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'engagement_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(201, body)); @@ -191,7 +191,7 @@ describe('Engagement', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -214,7 +214,7 @@ describe('Engagement', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js b/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js index 33f0afa437..860037ad86 100644 --- a/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement/engagementContext.spec.js @@ -31,7 +31,7 @@ describe('EngagementContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('EngagementContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -63,7 +63,7 @@ describe('EngagementContext', function() { 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'engagement_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement/step.spec.js b/spec/integration/rest/studio/v1/flow/engagement/step.spec.js index eda377405d..4b0611c599 100644 --- a/spec/integration/rest/studio/v1/flow/engagement/step.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement/step.spec.js @@ -31,7 +31,7 @@ describe('Step', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('Step', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -66,7 +66,7 @@ describe('Step', function() { 'key': 'steps' }, 'steps': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Step', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('Step', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -123,7 +123,7 @@ describe('Step', function() { 'links': { 'step_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js b/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js index 25c1e29276..e86a24bced 100644 --- a/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js +++ b/spec/integration/rest/studio/v1/flow/engagement/step/stepContext.spec.js @@ -31,7 +31,7 @@ describe('StepContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .engagements('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -57,7 +57,7 @@ describe('StepContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -66,7 +66,7 @@ describe('StepContext', function() { 'engagement_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'step_sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Engagements/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/execution.spec.js b/spec/integration/rest/studio/v1/flow/execution.spec.js index f5521de2f3..1666613149 100644 --- a/spec/integration/rest/studio/v1/flow/execution.spec.js +++ b/spec/integration/rest/studio/v1/flow/execution.spec.js @@ -31,7 +31,7 @@ describe('Execution', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions.list(); @@ -53,7 +53,7 @@ describe('Execution', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -64,7 +64,7 @@ describe('Execution', function() { 'key': 'executions' }, 'executions': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Execution', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Execution', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -118,7 +118,7 @@ describe('Execution', function() { 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'execution_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); @@ -134,7 +134,7 @@ describe('Execution', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: '+15558675310', from: '+15017122661'}; var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('Execution', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -174,7 +174,7 @@ describe('Execution', function() { 'steps': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'execution_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(201, body)); @@ -191,7 +191,7 @@ describe('Execution', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -214,7 +214,7 @@ describe('Execution', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/studio/v1/flow/execution/executionContext.spec.js b/spec/integration/rest/studio/v1/flow/execution/executionContext.spec.js index 9b17919afc..44ce39bdcc 100644 --- a/spec/integration/rest/studio/v1/flow/execution/executionContext.spec.js +++ b/spec/integration/rest/studio/v1/flow/execution/executionContext.spec.js @@ -31,7 +31,7 @@ describe('ExecutionContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('ExecutionContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -63,7 +63,7 @@ describe('ExecutionContext', function() { 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'execution_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/execution/executionStep.spec.js b/spec/integration/rest/studio/v1/flow/execution/executionStep.spec.js index 009b7e2496..bedf2fc857 100644 --- a/spec/integration/rest/studio/v1/flow/execution/executionStep.spec.js +++ b/spec/integration/rest/studio/v1/flow/execution/executionStep.spec.js @@ -31,7 +31,7 @@ describe('ExecutionStep', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('ExecutionStep', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -66,7 +66,7 @@ describe('ExecutionStep', function() { 'key': 'steps' }, 'steps': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('ExecutionStep', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('ExecutionStep', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -123,7 +123,7 @@ describe('ExecutionStep', function() { 'links': { 'step_context': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v1/flow/execution/executionStep/executionStepContext.spec.js b/spec/integration/rest/studio/v1/flow/execution/executionStep/executionStepContext.spec.js index 119a62154c..51c08d99cc 100644 --- a/spec/integration/rest/studio/v1/flow/execution/executionStep/executionStepContext.spec.js +++ b/spec/integration/rest/studio/v1/flow/execution/executionStep/executionStepContext.spec.js @@ -31,7 +31,7 @@ describe('ExecutionStepContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v1.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -57,7 +57,7 @@ describe('ExecutionStepContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -66,7 +66,7 @@ describe('ExecutionStepContext', function() { 'execution_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'step_sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v1/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flow.spec.js b/spec/integration/rest/studio/v2/flow.spec.js index 370deb8436..692ab09ea7 100644 --- a/spec/integration/rest/studio/v2/flow.spec.js +++ b/spec/integration/rest/studio/v2/flow.spec.js @@ -33,7 +33,7 @@ describe('Flow', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', status: 'draft', definition: {}}; var promise = client.studio.v2.flows.create(opts); @@ -56,7 +56,7 @@ describe('Flow', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'definition': { @@ -77,7 +77,7 @@ describe('Flow', function() { 'revisions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions', 'executions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -93,7 +93,7 @@ describe('Flow', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {status: 'draft'}; var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); @@ -117,7 +117,7 @@ describe('Flow', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'definition': { @@ -138,7 +138,7 @@ describe('Flow', function() { 'revisions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions', 'executions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -154,7 +154,7 @@ describe('Flow', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -186,14 +186,14 @@ describe('Flow', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -225,7 +225,7 @@ describe('Flow', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -237,7 +237,7 @@ describe('Flow', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -269,14 +269,14 @@ describe('Flow', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows.list(); promise.then(function() { @@ -296,7 +296,7 @@ describe('Flow', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -328,7 +328,7 @@ describe('Flow', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('Flow', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -364,7 +364,7 @@ describe('Flow', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'Test Flow', @@ -385,7 +385,7 @@ describe('Flow', function() { 'revisions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions', 'executions': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -400,7 +400,7 @@ describe('Flow', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -421,7 +421,7 @@ describe('Flow', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/studio/v2/flow/execution.spec.js b/spec/integration/rest/studio/v2/flow/execution.spec.js index 8b3e8aa7af..b225dea746 100644 --- a/spec/integration/rest/studio/v2/flow/execution.spec.js +++ b/spec/integration/rest/studio/v2/flow/execution.spec.js @@ -31,7 +31,7 @@ describe('Execution', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions.list(); @@ -53,7 +53,7 @@ describe('Execution', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -64,7 +64,7 @@ describe('Execution', function() { 'key': 'executions' }, 'executions': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Execution', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -103,7 +103,7 @@ describe('Execution', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -117,7 +117,7 @@ describe('Execution', function() { 'steps': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'execution_context': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); @@ -133,7 +133,7 @@ describe('Execution', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: '+15558675310', from: '+15017122661'}; var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -158,7 +158,7 @@ describe('Execution', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -172,7 +172,7 @@ describe('Execution', function() { 'steps': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps', 'execution_context': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(201, body)); @@ -189,7 +189,7 @@ describe('Execution', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -212,7 +212,7 @@ describe('Execution', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/studio/v2/flow/execution/executionContext.spec.js b/spec/integration/rest/studio/v2/flow/execution/executionContext.spec.js index 83f3a01339..3ff78746ea 100644 --- a/spec/integration/rest/studio/v2/flow/execution/executionContext.spec.js +++ b/spec/integration/rest/studio/v2/flow/execution/executionContext.spec.js @@ -31,7 +31,7 @@ describe('ExecutionContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('ExecutionContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -63,7 +63,7 @@ describe('ExecutionContext', function() { 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'execution_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flow/execution/executionStep.spec.js b/spec/integration/rest/studio/v2/flow/execution/executionStep.spec.js index 383a0976b1..5e23ca81a0 100644 --- a/spec/integration/rest/studio/v2/flow/execution/executionStep.spec.js +++ b/spec/integration/rest/studio/v2/flow/execution/executionStep.spec.js @@ -31,7 +31,7 @@ describe('ExecutionStep', function() { }); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('ExecutionStep', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -66,7 +66,7 @@ describe('ExecutionStep', function() { 'key': 'steps' }, 'steps': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('ExecutionStep', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('ExecutionStep', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'flow_sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -123,7 +123,7 @@ describe('ExecutionStep', function() { 'links': { 'step_context': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flow/execution/executionStep/executionStepContext.spec.js b/spec/integration/rest/studio/v2/flow/execution/executionStep/executionStepContext.spec.js index 3105a6fb9f..80f8cdd7e4 100644 --- a/spec/integration/rest/studio/v2/flow/execution/executionStep/executionStepContext.spec.js +++ b/spec/integration/rest/studio/v2/flow/execution/executionStep/executionStepContext.spec.js @@ -31,7 +31,7 @@ describe('ExecutionStepContext', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .executions('FNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -57,7 +57,7 @@ describe('ExecutionStepContext', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'context': { 'foo': 'bar' @@ -66,7 +66,7 @@ describe('ExecutionStepContext', function() { 'execution_sid': 'FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'step_sid': 'FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Executions/FNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Steps/FTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Context' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flow/flowRevision.spec.js b/spec/integration/rest/studio/v2/flow/flowRevision.spec.js index 1854884aff..7ffe44b3ec 100644 --- a/spec/integration/rest/studio/v2/flow/flowRevision.spec.js +++ b/spec/integration/rest/studio/v2/flow/flowRevision.spec.js @@ -31,7 +31,7 @@ describe('FlowRevision', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -57,7 +57,7 @@ describe('FlowRevision', function() { 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1' } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .revisions.each(() => done()); @@ -65,7 +65,7 @@ describe('FlowRevision', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -91,7 +91,7 @@ describe('FlowRevision', function() { 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1' } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .revisions.each({pageSize: 20}, () => done()); @@ -104,7 +104,7 @@ describe('FlowRevision', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -130,7 +130,7 @@ describe('FlowRevision', function() { 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1' } ] - }); + }; holodeck.mock(new Response(200, body)); client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .revisions.each({callback: () => done()}, () => fail('wrong callback!')); @@ -138,7 +138,7 @@ describe('FlowRevision', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .revisions.list(); @@ -160,7 +160,7 @@ describe('FlowRevision', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'previous_page_url': null, 'next_page_url': null, @@ -186,7 +186,7 @@ describe('FlowRevision', function() { 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -202,7 +202,7 @@ describe('FlowRevision', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .revisions('revision').fetch(); @@ -225,7 +225,7 @@ describe('FlowRevision', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'definition': { @@ -240,7 +240,7 @@ describe('FlowRevision', function() { 'date_created': '2017-11-06T12:00:00Z', 'date_updated': null, 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Revisions/1' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flow/testUser.spec.js b/spec/integration/rest/studio/v2/flow/testUser.spec.js index cdb846218b..5e591ce41a 100644 --- a/spec/integration/rest/studio/v2/flow/testUser.spec.js +++ b/spec/integration/rest/studio/v2/flow/testUser.spec.js @@ -33,7 +33,7 @@ describe('FlowTestUser', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .testUsers().fetch(); @@ -55,14 +55,14 @@ describe('FlowTestUser', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'test_users': [ 'user1', 'user2' ], 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('FlowTestUser', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {testUsers: ['test_users']}; var promise = client.studio.v2.flows('FWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -103,14 +103,14 @@ describe('FlowTestUser', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'test_users': [ 'user1', 'user2' ], 'url': 'https://studio.twilio.com/v2/Flows/FWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TestUsers' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/studio/v2/flowValidate.spec.js b/spec/integration/rest/studio/v2/flowValidate.spec.js index d8c3fde2eb..2ac4b3f9ad 100644 --- a/spec/integration/rest/studio/v2/flowValidate.spec.js +++ b/spec/integration/rest/studio/v2/flowValidate.spec.js @@ -33,7 +33,7 @@ describe('FlowValidate', function() { }); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', status: 'draft', definition: {}}; var promise = client.studio.v2.flowValid.update(opts); @@ -56,9 +56,9 @@ describe('FlowValidate', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'valid': true - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/supersim/v1/command.spec.js b/spec/integration/rest/supersim/v1/command.spec.js index fb0d3df157..a1a87025a6 100644 --- a/spec/integration/rest/supersim/v1/command.spec.js +++ b/spec/integration/rest/supersim/v1/command.spec.js @@ -31,7 +31,7 @@ describe('Command', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {sim: 'HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX', command: 'command'}; var promise = client.supersim.v1.commands.create(opts); @@ -54,7 +54,7 @@ describe('Command', function() { ); it('should generate valid create_command_minimal response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'date_created': '2015-07-30T20:00:00Z', @@ -64,7 +64,7 @@ describe('Command', function() { 'status': 'queued', 'direction': 'to_sim', 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -80,7 +80,7 @@ describe('Command', function() { ); it('should generate valid create_command_full response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'date_created': '2015-07-30T20:00:00Z', @@ -90,7 +90,7 @@ describe('Command', function() { 'status': 'queued', 'direction': 'to_sim', 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -106,7 +106,7 @@ describe('Command', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.commands('HCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -127,7 +127,7 @@ describe('Command', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'content of the command', @@ -137,7 +137,7 @@ describe('Command', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -152,7 +152,7 @@ describe('Command', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'key': 'commands', @@ -175,14 +175,14 @@ describe('Command', function() { 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.commands.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'key': 'commands', @@ -205,7 +205,7 @@ describe('Command', function() { 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.commands.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -217,7 +217,7 @@ describe('Command', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'key': 'commands', @@ -240,14 +240,14 @@ describe('Command', function() { 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.commands.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.commands.list(); promise.then(function() { @@ -267,7 +267,7 @@ describe('Command', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [], 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', @@ -278,7 +278,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -293,7 +293,7 @@ describe('Command', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Commands?Status=queued&Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', 'key': 'commands', @@ -316,7 +316,7 @@ describe('Command', function() { 'url': 'https://supersim.twilio.com/v1/Commands/HCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/supersim/v1/fleet.spec.js b/spec/integration/rest/supersim/v1/fleet.spec.js index a995c71580..ec139450b8 100644 --- a/spec/integration/rest/supersim/v1/fleet.spec.js +++ b/spec/integration/rest/supersim/v1/fleet.spec.js @@ -31,7 +31,7 @@ describe('Fleet', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.fleets.create(); promise.then(function() { @@ -51,7 +51,7 @@ describe('Fleet', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -63,7 +63,7 @@ describe('Fleet', function() { 'commands_url': 'https://google.com', 'sid': 'HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -78,7 +78,7 @@ describe('Fleet', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -99,7 +99,7 @@ describe('Fleet', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -111,7 +111,7 @@ describe('Fleet', function() { 'commands_url': null, 'sid': 'HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -126,7 +126,7 @@ describe('Fleet', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0', 'key': 'fleets', @@ -151,14 +151,14 @@ describe('Fleet', function() { 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.fleets.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0', 'key': 'fleets', @@ -183,7 +183,7 @@ describe('Fleet', function() { 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.fleets.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -195,7 +195,7 @@ describe('Fleet', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0', 'key': 'fleets', @@ -220,14 +220,14 @@ describe('Fleet', function() { 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.fleets.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.fleets.list(); promise.then(function() { @@ -247,7 +247,7 @@ describe('Fleet', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'fleets': [], 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0', @@ -258,7 +258,7 @@ describe('Fleet', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -273,7 +273,7 @@ describe('Fleet', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Fleets?PageSize=50&Page=0', 'key': 'fleets', @@ -298,7 +298,7 @@ describe('Fleet', function() { 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -313,7 +313,7 @@ describe('Fleet', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.fleets('HFXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -334,7 +334,7 @@ describe('Fleet', function() { ); it('should generate valid update_unique_name response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -346,7 +346,7 @@ describe('Fleet', function() { 'commands_url': null, 'sid': 'HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://supersim.twilio.com/v1/Fleets/HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/supersim/v1/sim.spec.js b/spec/integration/rest/supersim/v1/sim.spec.js index 298323dde0..dc01c8e63e 100644 --- a/spec/integration/rest/supersim/v1/sim.spec.js +++ b/spec/integration/rest/supersim/v1/sim.spec.js @@ -31,7 +31,7 @@ describe('Sim', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.sims('HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Sim', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'My SIM', @@ -62,7 +62,7 @@ describe('Sim', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -77,7 +77,7 @@ describe('Sim', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.sims('HSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -98,7 +98,7 @@ describe('Sim', function() { ); it('should generate valid update_unique_name response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'MySIM', @@ -108,7 +108,7 @@ describe('Sim', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -123,7 +123,7 @@ describe('Sim', function() { ); it('should generate valid update_status response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': null, @@ -133,7 +133,7 @@ describe('Sim', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -148,7 +148,7 @@ describe('Sim', function() { ); it('should generate valid update_fleet_with_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': null, @@ -158,7 +158,7 @@ describe('Sim', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -173,7 +173,7 @@ describe('Sim', function() { ); it('should generate valid update_fleet_with_unique_name response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': null, @@ -183,7 +183,7 @@ describe('Sim', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -198,7 +198,7 @@ describe('Sim', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=MyFleet&Iccid=11111111111111111111&PageSize=50&Page=0', 'key': 'sims', @@ -221,14 +221,14 @@ describe('Sim', function() { 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.sims.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=MyFleet&Iccid=11111111111111111111&PageSize=50&Page=0', 'key': 'sims', @@ -251,7 +251,7 @@ describe('Sim', function() { 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.sims.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -263,7 +263,7 @@ describe('Sim', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=MyFleet&Iccid=11111111111111111111&PageSize=50&Page=0', 'key': 'sims', @@ -286,14 +286,14 @@ describe('Sim', function() { 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.sims.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.sims.list(); promise.then(function() { @@ -313,7 +313,7 @@ describe('Sim', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [], 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Iccid=11111111111111111111&PageSize=50&Page=0', @@ -324,7 +324,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=HFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Iccid=11111111111111111111&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -339,7 +339,7 @@ describe('Sim', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://supersim.twilio.com/v1/Sims?Status=new&Fleet=MyFleet&Iccid=11111111111111111111&PageSize=50&Page=0', 'key': 'sims', @@ -362,7 +362,7 @@ describe('Sim', function() { 'url': 'https://supersim.twilio.com/v1/Sims/HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/supersim/v1/usageRecord.spec.js b/spec/integration/rest/supersim/v1/usageRecord.spec.js index f675779b8f..c62842bf59 100644 --- a/spec/integration/rest/supersim/v1/usageRecord.spec.js +++ b/spec/integration/rest/supersim/v1/usageRecord.spec.js @@ -31,7 +31,7 @@ describe('UsageRecord', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -54,14 +54,14 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.usageRecords.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -84,7 +84,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.usageRecords.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -96,7 +96,7 @@ describe('UsageRecord', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -119,14 +119,14 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.supersim.v1.usageRecords.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.supersim.v1.usageRecords.list(); promise.then(function() { @@ -146,7 +146,7 @@ describe('UsageRecord', function() { ); it('should generate valid read_all response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -169,7 +169,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -184,7 +184,7 @@ describe('UsageRecord', function() { ); it('should generate valid read_all_day response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -218,7 +218,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?Granularity=day&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -233,7 +233,7 @@ describe('UsageRecord', function() { ); it('should generate valid read_all_hour response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -267,7 +267,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?Granularity=hour&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -282,7 +282,7 @@ describe('UsageRecord', function() { ); it('should generate valid read_day_sim_filter response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'period': { @@ -316,7 +316,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://supersim.twilio.com/v1/UsageRecords?Sim=HSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Granularity=day&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service.spec.js b/spec/integration/rest/sync/v1/service.spec.js index 498918252a..60aa9b18b1 100644 --- a/spec/integration/rest/sync/v1/service.spec.js +++ b/spec/integration/rest/sync/v1/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Service', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -72,7 +72,7 @@ describe('Service', function() { 'acl_enabled': false, 'reachability_debouncing_enabled': false, 'reachability_debouncing_window': 5000 - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -108,7 +108,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -123,7 +123,7 @@ describe('Service', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services.create(); promise.then(function() { @@ -143,7 +143,7 @@ describe('Service', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -163,7 +163,7 @@ describe('Service', function() { 'acl_enabled': true, 'reachability_debouncing_enabled': false, 'reachability_debouncing_window': 5000 - }); + }; holodeck.mock(new Response(201, body)); @@ -178,7 +178,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0', 'key': 'services', @@ -211,14 +211,14 @@ describe('Service', function() { 'reachability_debouncing_window': 5000 } ] - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0', 'key': 'services', @@ -251,7 +251,7 @@ describe('Service', function() { 'reachability_debouncing_window': 5000 } ] - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -263,7 +263,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0', 'key': 'services', @@ -296,14 +296,14 @@ describe('Service', function() { 'reachability_debouncing_window': 5000 } ] - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services.list(); promise.then(function() { @@ -323,7 +323,7 @@ describe('Service', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0', 'key': 'services', @@ -334,7 +334,7 @@ describe('Service', function() { 'url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0' }, 'services': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -349,7 +349,7 @@ describe('Service', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services?PageSize=50&Page=0', 'key': 'services', @@ -382,7 +382,7 @@ describe('Service', function() { 'reachability_debouncing_window': 5000 } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -397,7 +397,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -418,7 +418,7 @@ describe('Service', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -438,7 +438,7 @@ describe('Service', function() { 'acl_enabled': true, 'reachability_debouncing_enabled': false, 'reachability_debouncing_window': 5000 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/document.spec.js b/spec/integration/rest/sync/v1/service/document.spec.js index 204eabb87b..2da1fbc9e8 100644 --- a/spec/integration/rest/sync/v1/service/document.spec.js +++ b/spec/integration/rest/sync/v1/service/document.spec.js @@ -31,7 +31,7 @@ describe('Document', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Document', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -69,7 +69,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('Document', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Document', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -127,7 +127,7 @@ describe('Document', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.create(); @@ -149,7 +149,7 @@ describe('Document', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -164,7 +164,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(201, body)); @@ -180,7 +180,7 @@ describe('Document', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -208,7 +208,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each(() => done()); @@ -216,7 +216,7 @@ describe('Document', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -244,7 +244,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each({pageSize: 20}, () => done()); @@ -257,7 +257,7 @@ describe('Document', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -285,7 +285,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.each({callback: () => done()}, () => fail('wrong callback!')); @@ -293,7 +293,7 @@ describe('Document', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents.list(); @@ -315,7 +315,7 @@ describe('Document', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0', @@ -326,7 +326,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -342,7 +342,7 @@ describe('Document', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'documents': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -370,7 +370,7 @@ describe('Document', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -386,7 +386,7 @@ describe('Document', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -412,7 +412,7 @@ describe('Document', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -427,7 +427,7 @@ describe('Document', function() { 'links': { 'permissions': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js b/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js index 26321ccc4e..0146c601df 100644 --- a/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/document/documentPermission.spec.js @@ -33,7 +33,7 @@ describe('DocumentPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('DocumentPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'document_sid': 'ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('DocumentPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('DocumentPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('DocumentPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('DocumentPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('DocumentPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('DocumentPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('DocumentPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .documents('ETXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('DocumentPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('DocumentPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('DocumentPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('DocumentPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('DocumentPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'document_sid': 'ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('DocumentPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Documents/ETaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncList.spec.js b/spec/integration/rest/sync/v1/service/syncList.spec.js index 923d3e5b3f..0d252fa6ca 100644 --- a/spec/integration/rest/sync/v1/service/syncList.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList.spec.js @@ -31,7 +31,7 @@ describe('SyncList', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('SyncList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -69,7 +69,7 @@ describe('SyncList', function() { 'sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('SyncList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -108,7 +108,7 @@ describe('SyncList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -124,7 +124,7 @@ describe('SyncList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.create(); @@ -146,7 +146,7 @@ describe('SyncList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -161,7 +161,7 @@ describe('SyncList', function() { 'sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -177,7 +177,7 @@ describe('SyncList', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -200,7 +200,7 @@ describe('SyncList', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -215,7 +215,7 @@ describe('SyncList', function() { 'sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('SyncList', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -259,7 +259,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each(() => done()); @@ -267,7 +267,7 @@ describe('SyncList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -295,7 +295,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each({pageSize: 20}, () => done()); @@ -308,7 +308,7 @@ describe('SyncList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -336,7 +336,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.each({callback: () => done()}, () => fail('wrong callback!')); @@ -344,7 +344,7 @@ describe('SyncList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists.list(); @@ -366,7 +366,7 @@ describe('SyncList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0', @@ -377,7 +377,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('SyncList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -421,7 +421,7 @@ describe('SyncList', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js b/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js index 160060d35d..abde725d20 100644 --- a/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList/syncListItem.spec.js @@ -33,7 +33,7 @@ describe('SyncListItem', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncListItem', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -70,7 +70,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('SyncListItem', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -115,7 +115,7 @@ describe('SyncListItem', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -132,7 +132,7 @@ describe('SyncListItem', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('SyncListItem', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -171,7 +171,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(201, body)); @@ -189,7 +189,7 @@ describe('SyncListItem', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -214,7 +214,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -223,7 +223,7 @@ describe('SyncListItem', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -248,7 +248,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -262,7 +262,7 @@ describe('SyncListItem', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -287,7 +287,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -296,7 +296,7 @@ describe('SyncListItem', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -320,7 +320,7 @@ describe('SyncListItem', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0', @@ -331,7 +331,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -348,7 +348,7 @@ describe('SyncListItem', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -373,7 +373,7 @@ describe('SyncListItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -390,7 +390,7 @@ describe('SyncListItem', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -418,7 +418,7 @@ describe('SyncListItem', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -430,7 +430,7 @@ describe('SyncListItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/100' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js b/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js index df39645ad6..3023a6a3bb 100644 --- a/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/syncList/syncListPermission.spec.js @@ -33,7 +33,7 @@ describe('SyncListPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncListPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'list_sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('SyncListPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncListPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('SyncListPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('SyncListPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('SyncListPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('SyncListPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('SyncListPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncLists('ESXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('SyncListPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('SyncListPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('SyncListPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('SyncListPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('SyncListPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'list_sid': 'ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('SyncListPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Lists/ESaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncMap.spec.js b/spec/integration/rest/sync/v1/service/syncMap.spec.js index 9ee7e6844b..fcb12b91f1 100644 --- a/spec/integration/rest/sync/v1/service/syncMap.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap.spec.js @@ -31,7 +31,7 @@ describe('SyncMap', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('SyncMap', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -69,7 +69,7 @@ describe('SyncMap', function() { 'sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -85,7 +85,7 @@ describe('SyncMap', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -108,7 +108,7 @@ describe('SyncMap', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -124,7 +124,7 @@ describe('SyncMap', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.create(); @@ -146,7 +146,7 @@ describe('SyncMap', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -161,7 +161,7 @@ describe('SyncMap', function() { 'sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -177,7 +177,7 @@ describe('SyncMap', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -200,7 +200,7 @@ describe('SyncMap', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -215,7 +215,7 @@ describe('SyncMap', function() { 'sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -231,7 +231,7 @@ describe('SyncMap', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -259,7 +259,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each(() => done()); @@ -267,7 +267,7 @@ describe('SyncMap', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -295,7 +295,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each({pageSize: 20}, () => done()); @@ -308,7 +308,7 @@ describe('SyncMap', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -336,7 +336,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.each({callback: () => done()}, () => fail('wrong callback!')); @@ -344,7 +344,7 @@ describe('SyncMap', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps.list(); @@ -366,7 +366,7 @@ describe('SyncMap', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0', @@ -377,7 +377,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -393,7 +393,7 @@ describe('SyncMap', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'maps': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -421,7 +421,7 @@ describe('SyncMap', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js b/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js index b487fcc7dc..0e25c57a5f 100644 --- a/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap/syncMapItem.spec.js @@ -33,7 +33,7 @@ describe('SyncMapItem', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncMapItem', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -70,7 +70,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('SyncMapItem', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -115,7 +115,7 @@ describe('SyncMapItem', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -132,7 +132,7 @@ describe('SyncMapItem', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {key: 'key', data: {}}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -159,7 +159,7 @@ describe('SyncMapItem', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -171,7 +171,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(201, body)); @@ -189,7 +189,7 @@ describe('SyncMapItem', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -214,7 +214,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -223,7 +223,7 @@ describe('SyncMapItem', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -248,7 +248,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -262,7 +262,7 @@ describe('SyncMapItem', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -287,7 +287,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -296,7 +296,7 @@ describe('SyncMapItem', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -320,7 +320,7 @@ describe('SyncMapItem', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0', @@ -331,7 +331,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -348,7 +348,7 @@ describe('SyncMapItem', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'items': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -373,7 +373,7 @@ describe('SyncMapItem', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items?From=from&Bounds=inclusive&Order=asc&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -390,7 +390,7 @@ describe('SyncMapItem', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ifMatch: 'if_match'}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -418,7 +418,7 @@ describe('SyncMapItem', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'data': {}, @@ -430,7 +430,7 @@ describe('SyncMapItem', function() { 'revision': 'revision', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Items/key' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js b/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js index 79d9c5b6b8..2120ee1ac0 100644 --- a/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js +++ b/spec/integration/rest/sync/v1/service/syncMap/syncMapPermission.spec.js @@ -33,7 +33,7 @@ describe('SyncMapPermission', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'map_sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -67,7 +67,7 @@ describe('SyncMapPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -109,7 +109,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -126,7 +126,7 @@ describe('SyncMapPermission', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -148,7 +148,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -157,7 +157,7 @@ describe('SyncMapPermission', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -179,7 +179,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -193,7 +193,7 @@ describe('SyncMapPermission', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -215,7 +215,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -224,7 +224,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncMaps('MPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -248,7 +248,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0', @@ -259,7 +259,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -276,7 +276,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'permissions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -298,7 +298,7 @@ describe('SyncMapPermission', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/sidOrUniqueName/Permissions?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -315,7 +315,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {read: true, write: true, manage: true}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -347,7 +347,7 @@ describe('SyncMapPermission', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'map_sid': 'MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -356,7 +356,7 @@ describe('SyncMapPermission', function() { 'write': true, 'manage': true, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Maps/MPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Permissions/identity' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncStream.spec.js b/spec/integration/rest/sync/v1/service/syncStream.spec.js index b3d1afe4ad..2f3c3ccac4 100644 --- a/spec/integration/rest/sync/v1/service/syncStream.spec.js +++ b/spec/integration/rest/sync/v1/service/syncStream.spec.js @@ -31,7 +31,7 @@ describe('SyncStream', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('SyncStream', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -67,7 +67,7 @@ describe('SyncStream', function() { 'sid': 'TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('SyncStream', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -106,7 +106,7 @@ describe('SyncStream', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -122,7 +122,7 @@ describe('SyncStream', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams.create(); @@ -144,7 +144,7 @@ describe('SyncStream', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -157,7 +157,7 @@ describe('SyncStream', function() { 'sid': 'TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -173,7 +173,7 @@ describe('SyncStream', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams('TOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -196,7 +196,7 @@ describe('SyncStream', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'created_by': 'created_by', 'date_expires': '2015-07-30T21:00:00Z', @@ -209,7 +209,7 @@ describe('SyncStream', function() { 'sid': 'TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams/TOaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -225,7 +225,7 @@ describe('SyncStream', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'streams': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('SyncStream', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams.each(() => done()); @@ -259,7 +259,7 @@ describe('SyncStream', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'streams': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -285,7 +285,7 @@ describe('SyncStream', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams.each({pageSize: 20}, () => done()); @@ -298,7 +298,7 @@ describe('SyncStream', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'streams': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -324,7 +324,7 @@ describe('SyncStream', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams.each({callback: () => done()}, () => fail('wrong callback!')); @@ -332,7 +332,7 @@ describe('SyncStream', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .syncStreams.list(); @@ -354,7 +354,7 @@ describe('SyncStream', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'streams': [], 'meta': { 'first_page_url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0', @@ -365,7 +365,7 @@ describe('SyncStream', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -381,7 +381,7 @@ describe('SyncStream', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'streams': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -407,7 +407,7 @@ describe('SyncStream', function() { 'previous_page_url': null, 'url': 'https://sync.twilio.com/v1/Services/ISaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Streams?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js b/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js index 91f065506f..ce06dc2999 100644 --- a/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js +++ b/spec/integration/rest/sync/v1/service/syncStream/streamMessage.spec.js @@ -33,7 +33,7 @@ describe('StreamMessage', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {data: {}}; var promise = client.sync.v1.services('ISXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -60,10 +60,10 @@ describe('StreamMessage', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TZaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'data': {} - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace.spec.js b/spec/integration/rest/taskrouter/v1/workspace.spec.js index 27f0f55049..80164f9555 100644 --- a/spec/integration/rest/taskrouter/v1/workspace.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace.spec.js @@ -31,7 +31,7 @@ describe('Workspace', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Workspace', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -79,7 +79,7 @@ describe('Workspace', function() { 'timeout_activity_name': 'Offline', 'timeout_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -94,7 +94,7 @@ describe('Workspace', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -115,7 +115,7 @@ describe('Workspace', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -142,7 +142,7 @@ describe('Workspace', function() { 'timeout_activity_name': 'Offline', 'timeout_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -157,7 +157,7 @@ describe('Workspace', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workspaces', @@ -197,14 +197,14 @@ describe('Workspace', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workspaces', @@ -244,7 +244,7 @@ describe('Workspace', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -256,7 +256,7 @@ describe('Workspace', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workspaces', @@ -296,14 +296,14 @@ describe('Workspace', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces.list(); promise.then(function() { @@ -323,7 +323,7 @@ describe('Workspace', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workspaces', @@ -363,7 +363,7 @@ describe('Workspace', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -378,7 +378,7 @@ describe('Workspace', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workspaces', @@ -389,7 +389,7 @@ describe('Workspace', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces?FriendlyName=friendly_name&PageSize=50&Page=0' }, 'workspaces': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -404,7 +404,7 @@ describe('Workspace', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.taskrouter.v1.workspaces.create(opts); @@ -427,7 +427,7 @@ describe('Workspace', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-08-01T22:10:40Z', 'date_updated': '2016-08-01T22:10:40Z', @@ -454,7 +454,7 @@ describe('Workspace', function() { 'timeout_activity_name': 'Offline', 'timeout_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -470,7 +470,7 @@ describe('Workspace', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -491,7 +491,7 @@ describe('Workspace', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js b/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js index 9f690a78b9..effb70070b 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/activity.spec.js @@ -31,7 +31,7 @@ describe('Activity', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities('WAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Activity', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'available': true, 'date_created': '2014-05-14T10:50:02Z', @@ -63,7 +63,7 @@ describe('Activity', function() { 'sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -79,7 +79,7 @@ describe('Activity', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities('WAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -102,7 +102,7 @@ describe('Activity', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'available': true, 'date_created': '2014-05-14T10:50:02Z', @@ -111,7 +111,7 @@ describe('Activity', function() { 'sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -127,7 +127,7 @@ describe('Activity', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities('WAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -150,7 +150,7 @@ describe('Activity', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -166,7 +166,7 @@ describe('Activity', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'activities': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -189,7 +189,7 @@ describe('Activity', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities.each(() => done()); @@ -197,7 +197,7 @@ describe('Activity', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'activities': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -220,7 +220,7 @@ describe('Activity', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities.each({pageSize: 20}, () => done()); @@ -233,7 +233,7 @@ describe('Activity', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'activities': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -256,7 +256,7 @@ describe('Activity', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities.each({callback: () => done()}, () => fail('wrong callback!')); @@ -264,7 +264,7 @@ describe('Activity', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .activities.list(); @@ -286,7 +286,7 @@ describe('Activity', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'activities': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -309,7 +309,7 @@ describe('Activity', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -325,7 +325,7 @@ describe('Activity', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'activities': [], 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0', @@ -337,7 +337,7 @@ describe('Activity', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -353,7 +353,7 @@ describe('Activity', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -378,7 +378,7 @@ describe('Activity', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'available': true, 'date_created': '2014-05-14T10:50:02Z', @@ -387,7 +387,7 @@ describe('Activity', function() { 'sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Activities/WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/event.spec.js b/spec/integration/rest/taskrouter/v1/workspace/event.spec.js index 838e665e88..5a7232f039 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/event.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/event.spec.js @@ -31,7 +31,7 @@ describe('Event', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events('EVXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Event', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'actor_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'actor_type': 'workspace', @@ -82,7 +82,7 @@ describe('Event', function() { 'source_ip_address': '1.2.3.4', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events/EVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -98,7 +98,7 @@ describe('Event', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -139,7 +139,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each(() => done()); @@ -147,7 +147,7 @@ describe('Event', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each({pageSize: 20}, () => done()); @@ -201,7 +201,7 @@ describe('Event', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -242,7 +242,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.each({callback: () => done()}, () => fail('wrong callback!')); @@ -250,7 +250,7 @@ describe('Event', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .events.list(); @@ -272,7 +272,7 @@ describe('Event', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'events': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -313,7 +313,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -329,7 +329,7 @@ describe('Event', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'events': [], 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0', @@ -340,7 +340,7 @@ describe('Event', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Events?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-03T00%3A00%3A00Z&WorkerSid=WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&EventType=reservation.created&TaskSid=WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&WorkflowSid=WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&ReservationSid=WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/task.spec.js b/spec/integration/rest/taskrouter/v1/workspace/task.spec.js index e231e560b3..9f4e98304a 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/task.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/task.spec.js @@ -31,7 +31,7 @@ describe('Task', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Task', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'age': 25200, 'assignment_status': 'pending', @@ -81,7 +81,7 @@ describe('Task', function() { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -97,7 +97,7 @@ describe('Task', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -120,7 +120,7 @@ describe('Task', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'age': 25200, 'assignment_status': 'pending', @@ -147,7 +147,7 @@ describe('Task', function() { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -163,7 +163,7 @@ describe('Task', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -186,7 +186,7 @@ describe('Task', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -202,7 +202,7 @@ describe('Task', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&PageSize=50&Page=0', 'key': 'tasks', @@ -242,7 +242,7 @@ describe('Task', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each(() => done()); @@ -250,7 +250,7 @@ describe('Task', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&PageSize=50&Page=0', 'key': 'tasks', @@ -290,7 +290,7 @@ describe('Task', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({pageSize: 20}, () => done()); @@ -303,7 +303,7 @@ describe('Task', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&PageSize=50&Page=0', 'key': 'tasks', @@ -343,7 +343,7 @@ describe('Task', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.each({callback: () => done()}, () => fail('wrong callback!')); @@ -351,7 +351,7 @@ describe('Task', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.list(); @@ -373,7 +373,7 @@ describe('Task', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending%2Creserved&PageSize=50&Page=0', 'key': 'tasks', @@ -413,7 +413,7 @@ describe('Task', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -429,7 +429,7 @@ describe('Task', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&PageSize=50&Page=0', 'key': 'tasks', @@ -440,7 +440,7 @@ describe('Task', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&PageSize=50&Page=0' }, 'tasks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -456,7 +456,7 @@ describe('Task', function() { ); it('should generate valid read_assignment_status_multiple response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&PageSize=50&Page=0', 'key': 'tasks', @@ -467,7 +467,7 @@ describe('Task', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks?TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&Priority=1&TaskQueueName=task_queue_name&WorkflowName=workflow_name&WorkflowSid=WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&AssignmentStatus=pending&PageSize=50&Page=0' }, 'tasks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -483,7 +483,7 @@ describe('Task', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks.create(); @@ -505,7 +505,7 @@ describe('Task', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'age': 25200, 'assignment_status': 'pending', @@ -532,7 +532,7 @@ describe('Task', function() { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/task/reservation.spec.js b/spec/integration/rest/taskrouter/v1/workspace/task/reservation.spec.js index 4b4b41fc1e..c35d625c1e 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/task/reservation.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/task/reservation.spec.js @@ -31,7 +31,7 @@ describe('Reservation', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -60,7 +60,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -69,7 +69,7 @@ describe('Reservation', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -98,7 +98,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Reservation', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -141,7 +141,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -150,7 +150,7 @@ describe('Reservation', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -174,7 +174,7 @@ describe('Reservation', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -203,7 +203,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -220,7 +220,7 @@ describe('Reservation', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -231,7 +231,7 @@ describe('Reservation', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Tasks/WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0' }, 'reservations': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -248,7 +248,7 @@ describe('Reservation', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -273,7 +273,7 @@ describe('Reservation', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2014-05-14T10:50:02Z', 'date_updated': '2014-05-15T16:03:42Z', @@ -289,7 +289,7 @@ describe('Reservation', function() { 'worker_name': 'Doug', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -306,7 +306,7 @@ describe('Reservation', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .tasks('WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -331,7 +331,7 @@ describe('Reservation', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2014-05-14T10:50:02Z', 'date_updated': '2014-05-15T16:03:42Z', @@ -347,7 +347,7 @@ describe('Reservation', function() { 'worker_name': 'Doug', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -364,7 +364,7 @@ describe('Reservation', function() { ); it('should generate valid update_supervise_instruction response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2014-05-14T10:50:02Z', 'date_updated': '2014-05-15T16:03:42Z', @@ -380,7 +380,7 @@ describe('Reservation', function() { 'worker_name': 'Doug', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js index 418146bedb..94728ff4c4 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskChannel.spec.js @@ -31,7 +31,7 @@ describe('TaskChannel', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('TaskChannel', function() { ); it('should generate valid fetch_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-04-14T17:35:54Z', 'date_updated': '2016-04-14T17:35:54Z', @@ -67,7 +67,7 @@ describe('TaskChannel', function() { 'links': { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('TaskChannel', function() { ); it('should generate valid fetch_unique_name response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2016-04-14T17:35:54Z', 'date_updated': '2016-04-14T17:35:54Z', @@ -96,7 +96,7 @@ describe('TaskChannel', function() { 'links': { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -112,7 +112,7 @@ describe('TaskChannel', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -138,7 +138,7 @@ describe('TaskChannel', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels.each(() => done()); @@ -146,7 +146,7 @@ describe('TaskChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -172,7 +172,7 @@ describe('TaskChannel', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels.each({pageSize: 20}, () => done()); @@ -185,7 +185,7 @@ describe('TaskChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -211,7 +211,7 @@ describe('TaskChannel', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels.each({callback: () => done()}, () => fail('wrong callback!')); @@ -219,7 +219,7 @@ describe('TaskChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels.list(); @@ -241,7 +241,7 @@ describe('TaskChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -267,7 +267,7 @@ describe('TaskChannel', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -283,7 +283,7 @@ describe('TaskChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'channels': [], 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0', @@ -294,7 +294,7 @@ describe('TaskChannel', function() { 'previous_page_url': null, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskChannels?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -310,7 +310,7 @@ describe('TaskChannel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -333,7 +333,7 @@ describe('TaskChannel', function() { ); it('should generate valid update_sid response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -346,7 +346,7 @@ describe('TaskChannel', function() { 'links': { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -362,7 +362,7 @@ describe('TaskChannel', function() { ); it('should generate valid update_unique_name response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -375,7 +375,7 @@ describe('TaskChannel', function() { 'links': { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -391,7 +391,7 @@ describe('TaskChannel', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskChannels('TCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -414,7 +414,7 @@ describe('TaskChannel', function() { ); it('should generate valid delete_sid response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -430,7 +430,7 @@ describe('TaskChannel', function() { ); it('should generate valid delete_unique_name response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -446,7 +446,7 @@ describe('TaskChannel', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', uniqueName: 'unique_name'}; var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -471,7 +471,7 @@ describe('TaskChannel', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'sid': 'TCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -484,7 +484,7 @@ describe('TaskChannel', function() { 'links': { 'workspace': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js index 067bf9b084..079bb1b7e9 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue.spec.js @@ -31,7 +31,7 @@ describe('TaskQueue', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('TaskQueue', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_activity_name': '817ca1c5-3a05-11e5-9292-98e0d9a1eb73', 'assignment_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -78,7 +78,7 @@ describe('TaskQueue', function() { 'task_order': 'FIFO', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -94,7 +94,7 @@ describe('TaskQueue', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -117,7 +117,7 @@ describe('TaskQueue', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_activity_name': '817ca1c5-3a05-11e5-9292-98e0d9a1eb73', 'assignment_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -141,7 +141,7 @@ describe('TaskQueue', function() { 'task_order': 'FIFO', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -157,7 +157,7 @@ describe('TaskQueue', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'task_queues', @@ -194,7 +194,7 @@ describe('TaskQueue', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues.each(() => done()); @@ -202,7 +202,7 @@ describe('TaskQueue', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'task_queues', @@ -239,7 +239,7 @@ describe('TaskQueue', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues.each({pageSize: 20}, () => done()); @@ -252,7 +252,7 @@ describe('TaskQueue', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'task_queues', @@ -289,7 +289,7 @@ describe('TaskQueue', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues.each({callback: () => done()}, () => fail('wrong callback!')); @@ -297,7 +297,7 @@ describe('TaskQueue', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues.list(); @@ -319,7 +319,7 @@ describe('TaskQueue', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'task_queues', @@ -356,7 +356,7 @@ describe('TaskQueue', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -372,7 +372,7 @@ describe('TaskQueue', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'task_queues', @@ -383,7 +383,7 @@ describe('TaskQueue', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues?EvaluateWorkerAttributes=evaluate_worker_attributes&FriendlyName=friendly_name&PageSize=50&Page=0' }, 'task_queues': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -399,7 +399,7 @@ describe('TaskQueue', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -424,7 +424,7 @@ describe('TaskQueue', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_activity_name': '817ca1c5-3a05-11e5-9292-98e0d9a1eb73', 'assignment_activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -448,7 +448,7 @@ describe('TaskQueue', function() { 'task_order': 'FIFO', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -465,7 +465,7 @@ describe('TaskQueue', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -488,7 +488,7 @@ describe('TaskQueue', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.spec.js index 0e36721e8f..80cf0869fe 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueCumulativeStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskQueueCumulativeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('TaskQueueCumulativeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'reservations_created': 100, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'reservations_rejected': 100, @@ -114,7 +114,7 @@ describe('TaskQueueCumulativeStatistics', function() { 'tasks_deleted': 100, 'reservations_rescinded': 100, 'avg_task_acceptance_time': 100 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.spec.js index a9eafd8577..2537e05c19 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueRealTimeStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskQueueRealTimeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('TaskQueueRealTimeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'longest_task_waiting_age': 100, 'longest_task_waiting_sid': 'WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'longest_relative_task_age_in_queue': 100, @@ -96,7 +96,7 @@ describe('TaskQueueRealTimeStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'total_available_workers': 100, 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.spec.js index 8655c6b9c6..16d567109c 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueueStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskQueueStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues('WQXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('TaskQueueStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics', 'cumulative': { @@ -120,7 +120,7 @@ describe('TaskQueueStatistics', function() { }, 'task_queue_sid': 'WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js index 52a3b42024..e6a6a42c12 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/taskQueue/taskQueuesStatistics.spec.js @@ -31,7 +31,7 @@ describe('TaskQueuesStatistics', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0', 'key': 'task_queues_statistics', @@ -108,7 +108,7 @@ describe('TaskQueuesStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues @@ -117,7 +117,7 @@ describe('TaskQueuesStatistics', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0', 'key': 'task_queues_statistics', @@ -194,7 +194,7 @@ describe('TaskQueuesStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues @@ -208,7 +208,7 @@ describe('TaskQueuesStatistics', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0', 'key': 'task_queues_statistics', @@ -285,7 +285,7 @@ describe('TaskQueuesStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues @@ -294,7 +294,7 @@ describe('TaskQueuesStatistics', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .taskQueues @@ -317,7 +317,7 @@ describe('TaskQueuesStatistics', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0', 'key': 'task_queues_statistics', @@ -394,7 +394,7 @@ describe('TaskQueuesStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -411,7 +411,7 @@ describe('TaskQueuesStatistics', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0', 'key': 'task_queues_statistics', @@ -422,7 +422,7 @@ describe('TaskQueuesStatistics', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TaskQueues/Statistics?FriendlyName=friendly_name&StartDate=2008-01-02T00%3A00%3A00Z&EndDate=2008-01-02T00%3A00%3A00Z&Minutes=1&PageSize=50&Page=0' }, 'task_queues_statistics': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js index be9fe3025d..a64937ac81 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker.spec.js @@ -31,7 +31,7 @@ describe('Worker', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -68,7 +68,7 @@ describe('Worker', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers.each(() => done()); @@ -76,7 +76,7 @@ describe('Worker', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -113,7 +113,7 @@ describe('Worker', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers.each({pageSize: 20}, () => done()); @@ -126,7 +126,7 @@ describe('Worker', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -163,7 +163,7 @@ describe('Worker', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -171,7 +171,7 @@ describe('Worker', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers.list(); @@ -193,7 +193,7 @@ describe('Worker', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -230,7 +230,7 @@ describe('Worker', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -246,7 +246,7 @@ describe('Worker', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?Available=available&TargetWorkersExpression=target_workers_expression&TaskQueueName=task_queue_name&ActivityName=activity_name&ActivitySid=WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workers', @@ -257,7 +257,7 @@ describe('Worker', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers?Available=available&TargetWorkersExpression=target_workers_expression&TaskQueueName=task_queue_name&ActivityName=activity_name&ActivitySid=WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&TaskQueueSid=WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa&FriendlyName=friendly_name&PageSize=50&Page=0' }, 'workers': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -273,7 +273,7 @@ describe('Worker', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -298,7 +298,7 @@ describe('Worker', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'NewWorker', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -322,7 +322,7 @@ describe('Worker', function() { 'worker_channels': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(201, body)); @@ -339,7 +339,7 @@ describe('Worker', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -362,7 +362,7 @@ describe('Worker', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'activity_name': 'available', 'activity_sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -386,7 +386,7 @@ describe('Worker', function() { 'worker_channels': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -402,7 +402,7 @@ describe('Worker', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -425,7 +425,7 @@ describe('Worker', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'blah', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -449,7 +449,7 @@ describe('Worker', function() { 'worker_channels': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels', 'reservations': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -465,7 +465,7 @@ describe('Worker', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -488,7 +488,7 @@ describe('Worker', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/reservation.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/reservation.spec.js index 8ef987bccb..b507658ed4 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/reservation.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/reservation.spec.js @@ -31,7 +31,7 @@ describe('Reservation', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -60,7 +60,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -69,7 +69,7 @@ describe('Reservation', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -98,7 +98,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -112,7 +112,7 @@ describe('Reservation', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -141,7 +141,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -150,7 +150,7 @@ describe('Reservation', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -174,7 +174,7 @@ describe('Reservation', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -203,7 +203,7 @@ describe('Reservation', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -220,7 +220,7 @@ describe('Reservation', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0', 'key': 'reservations', @@ -231,7 +231,7 @@ describe('Reservation', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Reservations?PageSize=50&Page=0' }, 'reservations': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -248,7 +248,7 @@ describe('Reservation', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -273,7 +273,7 @@ describe('Reservation', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2014-05-14T10:50:02Z', 'date_updated': '2014-05-15T16:03:42Z', @@ -289,7 +289,7 @@ describe('Reservation', function() { 'worker_name': 'Doug', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -306,7 +306,7 @@ describe('Reservation', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -331,7 +331,7 @@ describe('Reservation', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2014-05-14T10:50:02Z', 'date_updated': '2014-05-15T16:03:42Z', @@ -347,7 +347,7 @@ describe('Reservation', function() { 'worker_name': 'Doug', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workerChannel.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workerChannel.spec.js index 066f106380..bd9d7e354d 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workerChannel.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workerChannel.spec.js @@ -31,7 +31,7 @@ describe('WorkerChannel', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0', 'key': 'channels', @@ -58,7 +58,7 @@ describe('WorkerChannel', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -67,7 +67,7 @@ describe('WorkerChannel', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0', 'key': 'channels', @@ -94,7 +94,7 @@ describe('WorkerChannel', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('WorkerChannel', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0', 'key': 'channels', @@ -135,7 +135,7 @@ describe('WorkerChannel', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -144,7 +144,7 @@ describe('WorkerChannel', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -168,7 +168,7 @@ describe('WorkerChannel', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0', 'key': 'channels', @@ -195,7 +195,7 @@ describe('WorkerChannel', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -212,7 +212,7 @@ describe('WorkerChannel', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels?PageSize=50&Page=0', 'key': 'channels', @@ -223,7 +223,7 @@ describe('WorkerChannel', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels' }, 'channels': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -240,7 +240,7 @@ describe('WorkerChannel', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -265,7 +265,7 @@ describe('WorkerChannel', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assigned_tasks': 0, 'available': true, @@ -279,7 +279,7 @@ describe('WorkerChannel', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -296,7 +296,7 @@ describe('WorkerChannel', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -321,7 +321,7 @@ describe('WorkerChannel', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assigned_tasks': 0, 'available': true, @@ -335,7 +335,7 @@ describe('WorkerChannel', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Channels/WRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workerStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workerStatistics.spec.js index e8eb07228f..e2254e21c6 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workerStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workerStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkerStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('WorkerStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'cumulative': { 'reservations_created': 100, 'reservations_accepted': 100, @@ -104,7 +104,7 @@ describe('WorkerStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'worker_sid': 'WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/WKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js index 6e833217e2..9b9c83bb37 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersCumulativeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkersCumulativeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -54,7 +54,7 @@ describe('WorkersCumulativeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/CumulativeStatistics', @@ -100,7 +100,7 @@ describe('WorkersCumulativeStatistics', function() { ], 'start_time': '2015-07-30T20:00:00Z', 'end_time': '2015-07-30T20:00:00Z' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js index 754f60e066..e161f70cc0 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersRealTimeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkersRealTimeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers('WKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -54,7 +54,7 @@ describe('WorkersRealTimeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/RealTimeStatistics', @@ -81,7 +81,7 @@ describe('WorkersRealTimeStatistics', function() { 'sid': 'WAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js index 54893498e6..8088963891 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/worker/workersStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkersStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workers @@ -54,7 +54,7 @@ describe('WorkersStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'cumulative': { 'reservations_created': 0, 'reservations_accepted': 0, @@ -127,7 +127,7 @@ describe('WorkersStatistics', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workers/Statistics' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js index 96ad4948ea..3a88680b38 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workflow.spec.js @@ -31,7 +31,7 @@ describe('Workflow', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Workflow', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_callback_url': 'http://example.com', 'configuration': 'task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n', @@ -72,7 +72,7 @@ describe('Workflow', function() { 'real_time_statistics': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics', 'cumulative_statistics': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' } - }); + }; holodeck.mock(new Response(200, body)); @@ -88,7 +88,7 @@ describe('Workflow', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -111,7 +111,7 @@ describe('Workflow', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_callback_url': 'http://example.com', 'configuration': 'task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n', @@ -129,7 +129,7 @@ describe('Workflow', function() { 'cumulative_statistics': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' }, 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -145,7 +145,7 @@ describe('Workflow', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -168,7 +168,7 @@ describe('Workflow', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -184,7 +184,7 @@ describe('Workflow', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workflows', @@ -215,7 +215,7 @@ describe('Workflow', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows.each(() => done()); @@ -223,7 +223,7 @@ describe('Workflow', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workflows', @@ -254,7 +254,7 @@ describe('Workflow', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows.each({pageSize: 20}, () => done()); @@ -267,7 +267,7 @@ describe('Workflow', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workflows', @@ -298,7 +298,7 @@ describe('Workflow', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows.each({callback: () => done()}, () => fail('wrong callback!')); @@ -306,7 +306,7 @@ describe('Workflow', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows.list(); @@ -328,7 +328,7 @@ describe('Workflow', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workflows', @@ -359,7 +359,7 @@ describe('Workflow', function() { 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -375,7 +375,7 @@ describe('Workflow', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0', 'key': 'workflows', @@ -386,7 +386,7 @@ describe('Workflow', function() { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows?FriendlyName=friendly_name&PageSize=50&Page=0' }, 'workflows': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -402,7 +402,7 @@ describe('Workflow', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name', configuration: 'configuration'}; var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -427,7 +427,7 @@ describe('Workflow', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'assignment_callback_url': 'http://example.com', 'configuration': 'task-routing:\\n - filter: \\n - 1 == 1\\n target:\\n - queue: WQaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\\n set-priority: 0\\n', @@ -445,7 +445,7 @@ describe('Workflow', function() { 'real_time_statistics': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics', 'cumulative_statistics': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WFaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CumulativeStatistics' } - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.spec.js index ab4b7a2218..dcba3934a6 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowCumulativeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkflowCumulativeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('WorkflowCumulativeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'avg_task_acceptance_time': 100, 'tasks_canceled': 100, 'start_time': '2015-07-30T20:00:00Z', @@ -109,7 +109,7 @@ describe('WorkflowCumulativeStatistics', function() { 'tasks_timed_out_in_workflow': 100, 'tasks_completed': 100, 'reservations_timed_out': 100 - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.spec.js index 737d9b9f26..c608575796 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowRealTimeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkflowRealTimeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('WorkflowRealTimeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'longest_task_waiting_age': 100, 'longest_task_waiting_sid': 'WTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics', @@ -70,7 +70,7 @@ describe('WorkflowRealTimeStatistics', function() { 'workflow_sid': 'WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'total_tasks': 100, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowStatistics.spec.js index 01141cbf75..264348baf5 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workflow/workflowStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkflowStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .workflows('WWXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('WorkflowStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Workflows/WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics', 'cumulative': { @@ -83,7 +83,7 @@ describe('WorkflowStatistics', function() { }, 'workflow_sid': 'WWaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js index 318d3fed3a..e284fd1434 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceCumulativeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkspaceCumulativeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .cumulativeStatistics().fetch(); @@ -53,7 +53,7 @@ describe('WorkspaceCumulativeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'reservations_accepted': 100, 'tasks_completed': 100, 'start_time': '2015-07-30T20:00:00Z', @@ -106,7 +106,7 @@ describe('WorkspaceCumulativeStatistics', function() { 'reservations_rejected': 100, 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js index 8cfbc22611..f9f854c8ac 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceRealTimeStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkspaceRealTimeStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .realTimeStatistics().fetch(); @@ -53,7 +53,7 @@ describe('WorkspaceRealTimeStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RealTimeStatistics', 'tasks_by_priority': {}, 'activity_statistics': [ @@ -85,7 +85,7 @@ describe('WorkspaceRealTimeStatistics', function() { 'total_tasks': 100, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'tasks_by_status': {} - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js b/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js index b6645acf07..98596bc34b 100644 --- a/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js +++ b/spec/integration/rest/taskrouter/v1/workspace/workspaceStatistics.spec.js @@ -31,7 +31,7 @@ describe('WorkspaceStatistics', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.taskrouter.v1.workspaces('WSXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .statistics().fetch(); @@ -53,7 +53,7 @@ describe('WorkspaceStatistics', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://taskrouter.twilio.com/v1/Workspaces/WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Statistics', 'cumulative': { @@ -117,7 +117,7 @@ describe('WorkspaceStatistics', function() { 'total_workers': 1 }, 'workspace_sid': 'WSaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk.spec.js b/spec/integration/rest/trunking/v1/trunk.spec.js index 9f48e73144..12cb34250d 100644 --- a/spec/integration/rest/trunking/v1/trunk.spec.js +++ b/spec/integration/rest/trunking/v1/trunk.spec.js @@ -31,7 +31,7 @@ describe('Trunk', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Trunk', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'domain_name': 'test.pstn.twilio.com', @@ -78,7 +78,7 @@ describe('Trunk', function() { 'phone_numbers': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'terminating_sip_domains': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains' } - }); + }; holodeck.mock(new Response(200, body)); @@ -93,7 +93,7 @@ describe('Trunk', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -114,7 +114,7 @@ describe('Trunk', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -129,7 +129,7 @@ describe('Trunk', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks.create(); promise.then(function() { @@ -149,7 +149,7 @@ describe('Trunk', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'domain_name': 'test.pstn.twilio.com', @@ -175,7 +175,7 @@ describe('Trunk', function() { 'phone_numbers': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'terminating_sip_domains': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains' } - }); + }; holodeck.mock(new Response(201, body)); @@ -190,7 +190,7 @@ describe('Trunk', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', 'url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', @@ -229,14 +229,14 @@ describe('Trunk', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', 'url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', @@ -275,7 +275,7 @@ describe('Trunk', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -287,7 +287,7 @@ describe('Trunk', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', 'url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', @@ -326,14 +326,14 @@ describe('Trunk', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks.list(); promise.then(function() { @@ -353,7 +353,7 @@ describe('Trunk', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', 'url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', @@ -392,7 +392,7 @@ describe('Trunk', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -407,7 +407,7 @@ describe('Trunk', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', 'url': 'https://trunking.twilio.com/v1/Trunks?PageSize=50&Page=0', @@ -418,7 +418,7 @@ describe('Trunk', function() { 'previous_page_url': null }, 'trunks': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -433,7 +433,7 @@ describe('Trunk', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -454,7 +454,7 @@ describe('Trunk', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'domain_name': 'test.pstn.twilio.com', @@ -480,7 +480,7 @@ describe('Trunk', function() { 'phone_numbers': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'terminating_sip_domains': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains' } - }); + }; holodeck.mock(new Response(200, body)); @@ -495,7 +495,7 @@ describe('Trunk', function() { ); it('should generate valid update_set_from_domain response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'domain_name': 'test.pstn.twilio.com', @@ -521,7 +521,7 @@ describe('Trunk', function() { 'phone_numbers': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'terminating_sip_domains': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains' } - }); + }; holodeck.mock(new Response(200, body)); @@ -536,7 +536,7 @@ describe('Trunk', function() { ); it('should generate valid update_clear_from_domain response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'domain_name': 'test.pstn.twilio.com', @@ -562,7 +562,7 @@ describe('Trunk', function() { 'phone_numbers': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers', 'terminating_sip_domains': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js b/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js index 7ccbcfe261..7eb4e46fff 100644 --- a/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/credentialList.spec.js @@ -31,7 +31,7 @@ describe('CredentialList', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists('CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('CredentialList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'trunk_sid': 'TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2018-04-28T00:10:23Z', @@ -62,7 +62,7 @@ describe('CredentialList', function() { 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('CredentialList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists('CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -101,7 +101,7 @@ describe('CredentialList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -117,7 +117,7 @@ describe('CredentialList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {credentialListSid: 'CLXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -142,7 +142,7 @@ describe('CredentialList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'trunk_sid': 'TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2018-05-02T17:29:30Z', @@ -150,7 +150,7 @@ describe('CredentialList', function() { 'friendly_name': 'friendly_name', 'sid': 'CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/CredentialLists/CLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -167,7 +167,7 @@ describe('CredentialList', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('CredentialList', function() { 'next_page_url': null, 'key': 'credential_lists' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists.each(() => done()); @@ -196,7 +196,7 @@ describe('CredentialList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -217,7 +217,7 @@ describe('CredentialList', function() { 'next_page_url': null, 'key': 'credential_lists' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists.each({pageSize: 20}, () => done()); @@ -230,7 +230,7 @@ describe('CredentialList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('CredentialList', function() { 'next_page_url': null, 'key': 'credential_lists' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists.each({callback: () => done()}, () => fail('wrong callback!')); @@ -259,7 +259,7 @@ describe('CredentialList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .credentialsLists.list(); @@ -281,7 +281,7 @@ describe('CredentialList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -302,7 +302,7 @@ describe('CredentialList', function() { 'next_page_url': null, 'key': 'credential_lists' } - }); + }; holodeck.mock(new Response(200, body)); @@ -318,7 +318,7 @@ describe('CredentialList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'credential_lists': [], 'meta': { 'page': 0, @@ -329,7 +329,7 @@ describe('CredentialList', function() { 'next_page_url': null, 'key': 'credential_lists' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js b/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js index c35a251e38..727fa141df 100644 --- a/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/ipAccessControlList.spec.js @@ -31,7 +31,7 @@ describe('IpAccessControlList', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists('ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2018-05-02T17:29:34Z', 'date_updated': '2018-05-02T17:29:34Z', @@ -62,7 +62,7 @@ describe('IpAccessControlList', function() { 'sid': 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -78,7 +78,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists('ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -101,7 +101,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -117,7 +117,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {ipAccessControlListSid: 'ALXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -142,7 +142,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2018-04-30T20:59:06Z', 'date_updated': '2018-04-30T20:59:06Z', @@ -150,7 +150,7 @@ describe('IpAccessControlList', function() { 'sid': 'ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists/ALaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -167,7 +167,7 @@ describe('IpAccessControlList', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'ip_access_control_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -188,7 +188,7 @@ describe('IpAccessControlList', function() { 'previous_page_url': null, 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists.each(() => done()); @@ -196,7 +196,7 @@ describe('IpAccessControlList', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'ip_access_control_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -217,7 +217,7 @@ describe('IpAccessControlList', function() { 'previous_page_url': null, 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists.each({pageSize: 20}, () => done()); @@ -230,7 +230,7 @@ describe('IpAccessControlList', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'ip_access_control_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -251,7 +251,7 @@ describe('IpAccessControlList', function() { 'previous_page_url': null, 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists.each({callback: () => done()}, () => fail('wrong callback!')); @@ -259,7 +259,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .ipAccessControlLists.list(); @@ -281,7 +281,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'ip_access_control_lists': [], 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0', @@ -292,7 +292,7 @@ describe('IpAccessControlList', function() { 'previous_page_url': null, 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -308,7 +308,7 @@ describe('IpAccessControlList', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'ip_access_control_lists': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -329,7 +329,7 @@ describe('IpAccessControlList', function() { 'previous_page_url': null, 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IpAccessControlLists?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js b/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js index a764ee7e59..c8a1adfd83 100644 --- a/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/originationUrl.spec.js @@ -33,7 +33,7 @@ describe('OriginationUrl', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -56,7 +56,7 @@ describe('OriginationUrl', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'weight': 1, 'date_updated': '2018-05-07T20:20:46Z', 'enabled': false, @@ -68,7 +68,7 @@ describe('OriginationUrl', function() { 'date_created': '2018-05-07T20:20:46Z', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('OriginationUrl', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -107,7 +107,7 @@ describe('OriginationUrl', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -123,7 +123,7 @@ describe('OriginationUrl', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = { weight: 1, @@ -160,7 +160,7 @@ describe('OriginationUrl', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'weight': 1, 'date_updated': '2018-05-07T20:50:58Z', 'enabled': true, @@ -172,7 +172,7 @@ describe('OriginationUrl', function() { 'date_created': '2018-05-07T20:50:58Z', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -195,7 +195,7 @@ describe('OriginationUrl', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0', 'key': 'origination_urls', @@ -220,7 +220,7 @@ describe('OriginationUrl', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls.each(() => done()); @@ -228,7 +228,7 @@ describe('OriginationUrl', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0', 'key': 'origination_urls', @@ -253,7 +253,7 @@ describe('OriginationUrl', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls.each({pageSize: 20}, () => done()); @@ -266,7 +266,7 @@ describe('OriginationUrl', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0', 'key': 'origination_urls', @@ -291,7 +291,7 @@ describe('OriginationUrl', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls.each({callback: () => done()}, () => fail('wrong callback!')); @@ -299,7 +299,7 @@ describe('OriginationUrl', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls.list(); @@ -321,7 +321,7 @@ describe('OriginationUrl', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0', 'key': 'origination_urls', @@ -346,7 +346,7 @@ describe('OriginationUrl', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -362,7 +362,7 @@ describe('OriginationUrl', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0', 'key': 'origination_urls', @@ -373,7 +373,7 @@ describe('OriginationUrl', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls?PageSize=50&Page=0' }, 'origination_urls': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -389,7 +389,7 @@ describe('OriginationUrl', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .originationUrls('OUXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -412,7 +412,7 @@ describe('OriginationUrl', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'weight': 2, 'date_updated': '2018-05-07T20:50:58Z', 'enabled': false, @@ -424,7 +424,7 @@ describe('OriginationUrl', function() { 'date_created': '2018-05-07T20:50:58Z', 'trunk_sid': 'TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/OriginationUrls/OUaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js b/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js index 837e0b2938..11450ccc32 100644 --- a/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/phoneNumber.spec.js @@ -31,7 +31,7 @@ describe('PhoneNumber', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('PhoneNumber', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2010-12-10T17:27:34Z', 'date_updated': '2015-10-09T11:36:32Z', @@ -87,7 +87,7 @@ describe('PhoneNumber', function() { 'links': { 'phone_number': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' } - }); + }; holodeck.mock(new Response(200, body)); @@ -103,7 +103,7 @@ describe('PhoneNumber', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers('PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -126,7 +126,7 @@ describe('PhoneNumber', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -142,7 +142,7 @@ describe('PhoneNumber', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {phoneNumberSid: 'PNXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -167,7 +167,7 @@ describe('PhoneNumber', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2010-12-10T17:27:34Z', 'date_updated': '2015-10-09T11:36:32Z', @@ -200,7 +200,7 @@ describe('PhoneNumber', function() { 'links': { 'phone_number': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/IncomingPhoneNumbers/PNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.json' } - }); + }; holodeck.mock(new Response(201, body)); @@ -217,7 +217,7 @@ describe('PhoneNumber', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0', 'key': 'phone_numbers', @@ -263,7 +263,7 @@ describe('PhoneNumber', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each(() => done()); @@ -271,7 +271,7 @@ describe('PhoneNumber', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0', 'key': 'phone_numbers', @@ -317,7 +317,7 @@ describe('PhoneNumber', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({pageSize: 20}, () => done()); @@ -330,7 +330,7 @@ describe('PhoneNumber', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0', 'key': 'phone_numbers', @@ -376,7 +376,7 @@ describe('PhoneNumber', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.each({callback: () => done()}, () => fail('wrong callback!')); @@ -384,7 +384,7 @@ describe('PhoneNumber', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .phoneNumbers.list(); @@ -406,7 +406,7 @@ describe('PhoneNumber', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0', 'key': 'phone_numbers', @@ -452,7 +452,7 @@ describe('PhoneNumber', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -468,7 +468,7 @@ describe('PhoneNumber', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0', 'key': 'phone_numbers', @@ -479,7 +479,7 @@ describe('PhoneNumber', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PhoneNumbers?PageSize=1&Page=0' }, 'phone_numbers': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/trunking/v1/trunk/terminatingSipDomain.spec.js b/spec/integration/rest/trunking/v1/trunk/terminatingSipDomain.spec.js index bda2b4b05d..ad808c8a41 100644 --- a/spec/integration/rest/trunking/v1/trunk/terminatingSipDomain.spec.js +++ b/spec/integration/rest/trunking/v1/trunk/terminatingSipDomain.spec.js @@ -31,7 +31,7 @@ describe('TerminatingSipDomain', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'auth_type': 'IP_ACL', @@ -75,7 +75,7 @@ describe('TerminatingSipDomain', function() { 'links': { 'sip_domain': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains('SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -114,7 +114,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -130,7 +130,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {sipDomainSid: 'SDXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -155,7 +155,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'api_version': '2010-04-01', 'auth_type': 'IP_ACL', @@ -176,7 +176,7 @@ describe('TerminatingSipDomain', function() { 'links': { 'sip_domain': 'https://api.twilio.com/2010-04-01/Accounts/ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SIP/Domains/SDaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } - }); + }; holodeck.mock(new Response(201, body)); @@ -193,7 +193,7 @@ describe('TerminatingSipDomain', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0', 'key': 'sip_domains', @@ -227,7 +227,7 @@ describe('TerminatingSipDomain', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains.each(() => done()); @@ -235,7 +235,7 @@ describe('TerminatingSipDomain', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0', 'key': 'sip_domains', @@ -269,7 +269,7 @@ describe('TerminatingSipDomain', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains.each({pageSize: 20}, () => done()); @@ -282,7 +282,7 @@ describe('TerminatingSipDomain', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0', 'key': 'sip_domains', @@ -316,7 +316,7 @@ describe('TerminatingSipDomain', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains.each({callback: () => done()}, () => fail('wrong callback!')); @@ -324,7 +324,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.trunking.v1.trunks('TRXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .terminatingSipDomains.list(); @@ -346,7 +346,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0', 'key': 'sip_domains', @@ -380,7 +380,7 @@ describe('TerminatingSipDomain', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -396,7 +396,7 @@ describe('TerminatingSipDomain', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0', 'key': 'sip_domains', @@ -407,7 +407,7 @@ describe('TerminatingSipDomain', function() { 'url': 'https://trunking.twilio.com/v1/Trunks/TRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/TerminatingSipDomains?PageSize=50&Page=0' }, 'sip_domains': [] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/verify/v2/service.spec.js b/spec/integration/rest/verify/v2/service.spec.js index 5c30e4884d..4a04b440f9 100644 --- a/spec/integration/rest/verify/v2/service.spec.js +++ b/spec/integration/rest/verify/v2/service.spec.js @@ -31,7 +31,7 @@ describe('Service', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.verify.v2.services.create(opts); @@ -54,7 +54,7 @@ describe('Service', function() { ); it('should generate valid create_record response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'name', @@ -75,7 +75,7 @@ describe('Service', function() { 'rate_limits': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits', 'messaging_configurations': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations' } - }); + }; holodeck.mock(new Response(201, body)); @@ -91,7 +91,7 @@ describe('Service', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -112,7 +112,7 @@ describe('Service', function() { ); it('should generate valid fetch_record response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'name', @@ -133,7 +133,7 @@ describe('Service', function() { 'rate_limits': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits', 'messaging_configurations': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -148,7 +148,7 @@ describe('Service', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -169,7 +169,7 @@ describe('Service', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -184,7 +184,7 @@ describe('Service', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -218,14 +218,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -259,7 +259,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -271,7 +271,7 @@ describe('Service', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -305,14 +305,14 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services.list(); promise.then(function() { @@ -332,7 +332,7 @@ describe('Service', function() { ); it('should generate valid read_all response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -366,7 +366,7 @@ describe('Service', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -381,7 +381,7 @@ describe('Service', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -402,7 +402,7 @@ describe('Service', function() { ); it('should generate valid update_record response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'name', @@ -423,7 +423,7 @@ describe('Service', function() { 'rate_limits': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits', 'messaging_configurations': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/verify/v2/service/messagingConfiguration.spec.js b/spec/integration/rest/verify/v2/service/messagingConfiguration.spec.js index 29367da9c0..3b0b33b3eb 100644 --- a/spec/integration/rest/verify/v2/service/messagingConfiguration.spec.js +++ b/spec/integration/rest/verify/v2/service/messagingConfiguration.spec.js @@ -31,7 +31,7 @@ describe('MessagingConfiguration', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {country: 'country', messagingServiceSid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'country': 'CA', @@ -64,7 +64,7 @@ describe('MessagingConfiguration', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations/CA' - }); + }; holodeck.mock(new Response(201, body)); @@ -81,7 +81,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {messagingServiceSid: 'MGXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -107,7 +107,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'country': 'CA', @@ -115,7 +115,7 @@ describe('MessagingConfiguration', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations/CA' - }); + }; holodeck.mock(new Response(200, body)); @@ -132,7 +132,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations('country').fetch(); @@ -155,7 +155,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'country': 'CA', @@ -163,7 +163,7 @@ describe('MessagingConfiguration', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/MessagingConfigurations/CA' - }); + }; holodeck.mock(new Response(200, body)); @@ -179,7 +179,7 @@ describe('MessagingConfiguration', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'messaging_configurations': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -200,7 +200,7 @@ describe('MessagingConfiguration', function() { 'next_page_url': null, 'key': 'messaging_configurations' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations.each(() => done()); @@ -208,7 +208,7 @@ describe('MessagingConfiguration', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'messaging_configurations': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -229,7 +229,7 @@ describe('MessagingConfiguration', function() { 'next_page_url': null, 'key': 'messaging_configurations' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations.each({pageSize: 20}, () => done()); @@ -242,7 +242,7 @@ describe('MessagingConfiguration', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'messaging_configurations': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -263,7 +263,7 @@ describe('MessagingConfiguration', function() { 'next_page_url': null, 'key': 'messaging_configurations' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations.each({callback: () => done()}, () => fail('wrong callback!')); @@ -271,7 +271,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations.list(); @@ -293,7 +293,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'messaging_configurations': [], 'meta': { 'page': 0, @@ -304,7 +304,7 @@ describe('MessagingConfiguration', function() { 'next_page_url': null, 'key': 'messaging_configurations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -320,7 +320,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'messaging_configurations': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -341,7 +341,7 @@ describe('MessagingConfiguration', function() { 'next_page_url': null, 'key': 'messaging_configurations' } - }); + }; holodeck.mock(new Response(200, body)); @@ -357,7 +357,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .messagingConfigurations('country').remove(); @@ -380,7 +380,7 @@ describe('MessagingConfiguration', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/verify/v2/service/rateLimit.spec.js b/spec/integration/rest/verify/v2/service/rateLimit.spec.js index 6d2dee6940..38b60c46be 100644 --- a/spec/integration/rest/verify/v2/service/rateLimit.spec.js +++ b/spec/integration/rest/verify/v2/service/rateLimit.spec.js @@ -31,7 +31,7 @@ describe('RateLimit', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {uniqueName: 'unique_name'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('RateLimit', function() { ); it('should generate valid create_rate_limit response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('RateLimit', function() { 'links': { 'buckets': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets' } - }); + }; holodeck.mock(new Response(201, body)); @@ -85,7 +85,7 @@ describe('RateLimit', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -108,7 +108,7 @@ describe('RateLimit', function() { ); it('should generate valid update_rate_limit response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -120,7 +120,7 @@ describe('RateLimit', function() { 'links': { 'buckets': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets' } - }); + }; holodeck.mock(new Response(200, body)); @@ -136,7 +136,7 @@ describe('RateLimit', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -159,7 +159,7 @@ describe('RateLimit', function() { ); it('should generate valid fetch_rate_limit response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -171,7 +171,7 @@ describe('RateLimit', function() { 'links': { 'buckets': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets' } - }); + }; holodeck.mock(new Response(200, body)); @@ -187,7 +187,7 @@ describe('RateLimit', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -212,7 +212,7 @@ describe('RateLimit', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits.each(() => done()); @@ -220,7 +220,7 @@ describe('RateLimit', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -245,7 +245,7 @@ describe('RateLimit', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits.each({pageSize: 20}, () => done()); @@ -258,7 +258,7 @@ describe('RateLimit', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -283,7 +283,7 @@ describe('RateLimit', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits.each({callback: () => done()}, () => fail('wrong callback!')); @@ -291,7 +291,7 @@ describe('RateLimit', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits.list(); @@ -313,7 +313,7 @@ describe('RateLimit', function() { ); it('should generate valid read_all response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'page': 0, 'page_size': 50, @@ -338,7 +338,7 @@ describe('RateLimit', function() { } } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -354,7 +354,7 @@ describe('RateLimit', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -377,7 +377,7 @@ describe('RateLimit', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/verify/v2/service/rateLimit/bucket.spec.js b/spec/integration/rest/verify/v2/service/rateLimit/bucket.spec.js index d4ec9f1d9b..172c8a2ad8 100644 --- a/spec/integration/rest/verify/v2/service/rateLimit/bucket.spec.js +++ b/spec/integration/rest/verify/v2/service/rateLimit/bucket.spec.js @@ -31,7 +31,7 @@ describe('Bucket', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {max: 1, interval: 1}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -58,7 +58,7 @@ describe('Bucket', function() { ); it('should generate valid create_bucket response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'rate_limit_sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('Bucket', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets/BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -86,7 +86,7 @@ describe('Bucket', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('Bucket', function() { ); it('should generate valid update_bucket response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'rate_limit_sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -121,7 +121,7 @@ describe('Bucket', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets/BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -138,7 +138,7 @@ describe('Bucket', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -163,7 +163,7 @@ describe('Bucket', function() { ); it('should generate valid fetch_bucket response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'rate_limit_sid': 'RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -173,7 +173,7 @@ describe('Bucket', function() { 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/RateLimits/RKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Buckets/BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -190,7 +190,7 @@ describe('Bucket', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'buckets': [ { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -213,7 +213,7 @@ describe('Bucket', function() { 'next_page_url': null, 'key': 'buckets' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -222,7 +222,7 @@ describe('Bucket', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'buckets': [ { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -245,7 +245,7 @@ describe('Bucket', function() { 'next_page_url': null, 'key': 'buckets' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -259,7 +259,7 @@ describe('Bucket', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'buckets': [ { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -282,7 +282,7 @@ describe('Bucket', function() { 'next_page_url': null, 'key': 'buckets' } - }); + }; holodeck.mock(new Response(200, body)); client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -291,7 +291,7 @@ describe('Bucket', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -315,7 +315,7 @@ describe('Bucket', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'buckets': [], 'meta': { 'page': 0, @@ -326,7 +326,7 @@ describe('Bucket', function() { 'next_page_url': null, 'key': 'buckets' } - }); + }; holodeck.mock(new Response(200, body)); @@ -343,7 +343,7 @@ describe('Bucket', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'buckets': [ { 'sid': 'BLaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -366,7 +366,7 @@ describe('Bucket', function() { 'next_page_url': null, 'key': 'buckets' } - }); + }; holodeck.mock(new Response(200, body)); @@ -383,7 +383,7 @@ describe('Bucket', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .rateLimits('RKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -408,7 +408,7 @@ describe('Bucket', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/verify/v2/service/verification.spec.js b/spec/integration/rest/verify/v2/service/verification.spec.js index 83534f433d..e07760feb3 100644 --- a/spec/integration/rest/verify/v2/service/verification.spec.js +++ b/spec/integration/rest/verify/v2/service/verification.spec.js @@ -31,7 +31,7 @@ describe('Verification', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {to: 'to', channel: 'channel'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('Verification', function() { ); it('should generate valid create_verification response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -85,7 +85,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -102,7 +102,7 @@ describe('Verification', function() { ); it('should generate valid create_verification_email response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -131,7 +131,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -148,7 +148,7 @@ describe('Verification', function() { ); it('should generate valid create_verification_with_rate_limits response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -177,7 +177,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -194,7 +194,7 @@ describe('Verification', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {status: 'canceled'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -220,7 +220,7 @@ describe('Verification', function() { ); it('should generate valid update_verification response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -249,7 +249,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -266,7 +266,7 @@ describe('Verification', function() { ); it('should generate valid approve_verification_with_pn response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -295,7 +295,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -312,7 +312,7 @@ describe('Verification', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .verifications('sid').fetch(); @@ -335,7 +335,7 @@ describe('Verification', function() { ); it('should generate valid fetch_verification response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -364,7 +364,7 @@ describe('Verification', function() { } ], 'url': 'https://verify.twilio.com/v2/Services/VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Verifications/VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/verify/v2/service/verificationCheck.spec.js b/spec/integration/rest/verify/v2/service/verificationCheck.spec.js index 42fd43045f..390253107a 100644 --- a/spec/integration/rest/verify/v2/service/verificationCheck.spec.js +++ b/spec/integration/rest/verify/v2/service/verificationCheck.spec.js @@ -31,7 +31,7 @@ describe('VerificationCheck', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {code: 'code'}; var promise = client.verify.v2.services('VAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('VerificationCheck', function() { ); it('should generate valid verification_checks response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -68,7 +68,7 @@ describe('VerificationCheck', function() { 'payee': null, 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z' - }); + }; holodeck.mock(new Response(201, body)); @@ -85,7 +85,7 @@ describe('VerificationCheck', function() { ); it('should generate valid email_verification_checks response', function(done) { - var body = JSON.stringify({ + var body = { 'sid': 'VEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'service_sid': 'VAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -97,7 +97,7 @@ describe('VerificationCheck', function() { 'payee': null, 'date_created': '2020-01-30T20:00:00Z', 'date_updated': '2020-01-30T20:00:00Z' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/video/v1/composition.spec.js b/spec/integration/rest/video/v1/composition.spec.js index b39a42823f..59f3fe9f73 100644 --- a/spec/integration/rest/video/v1/composition.spec.js +++ b/spec/integration/rest/video/v1/composition.spec.js @@ -31,7 +31,7 @@ describe('Composition', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositions('CJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Composition', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'completed', 'date_created': '2015-07-30T20:00:00Z', @@ -113,7 +113,7 @@ describe('Composition', function() { 'links': { 'media': 'https://video.twilio.com/v1/Compositions/CJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' } - }); + }; holodeck.mock(new Response(200, body)); @@ -128,7 +128,7 @@ describe('Composition', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -198,14 +198,14 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositions.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -275,7 +275,7 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositions.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -287,7 +287,7 @@ describe('Composition', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -357,14 +357,14 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositions.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositions.list(); promise.then(function() { @@ -384,7 +384,7 @@ describe('Composition', function() { ); it('should generate valid read_enqueued response', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [], 'meta': { 'page': 0, @@ -395,7 +395,7 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -410,7 +410,7 @@ describe('Composition', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [], 'meta': { 'page': 0, @@ -421,7 +421,7 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -436,7 +436,7 @@ describe('Composition', function() { ); it('should generate valid read_results response', function(done) { - var body = JSON.stringify({ + var body = { 'compositions': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -506,7 +506,7 @@ describe('Composition', function() { 'next_page_url': null, 'key': 'compositions' } - }); + }; holodeck.mock(new Response(200, body)); @@ -521,7 +521,7 @@ describe('Composition', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositions('CJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -542,7 +542,7 @@ describe('Composition', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -557,7 +557,7 @@ describe('Composition', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {roomSid: 'RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'}; var promise = client.video.v1.compositions.create(opts); @@ -580,7 +580,7 @@ describe('Composition', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'processing', 'date_created': '2015-07-30T20:00:00Z', @@ -629,7 +629,7 @@ describe('Composition', function() { 'links': { 'media': 'https://video.twilio.com/v1/Compositions/CJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' } - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/video/v1/compositionHook.spec.js b/spec/integration/rest/video/v1/compositionHook.spec.js index 5869b8296e..ba97c630e3 100644 --- a/spec/integration/rest/video/v1/compositionHook.spec.js +++ b/spec/integration/rest/video/v1/compositionHook.spec.js @@ -31,7 +31,7 @@ describe('CompositionHook', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositionHooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('CompositionHook', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'My composition hook', 'enabled': true, @@ -105,7 +105,7 @@ describe('CompositionHook', function() { 'status_callback': 'http://www.example.com', 'status_callback_method': 'POST', 'url': 'https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -120,7 +120,7 @@ describe('CompositionHook', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'composition_hooks': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -184,14 +184,14 @@ describe('CompositionHook', function() { 'next_page_url': null, 'key': 'composition_hooks' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositionHooks.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'composition_hooks': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -255,7 +255,7 @@ describe('CompositionHook', function() { 'next_page_url': null, 'key': 'composition_hooks' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositionHooks.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -267,7 +267,7 @@ describe('CompositionHook', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'composition_hooks': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -331,14 +331,14 @@ describe('CompositionHook', function() { 'next_page_url': null, 'key': 'composition_hooks' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.compositionHooks.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositionHooks.list(); promise.then(function() { @@ -358,7 +358,7 @@ describe('CompositionHook', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'composition_hooks': [], 'meta': { 'page': 0, @@ -369,7 +369,7 @@ describe('CompositionHook', function() { 'next_page_url': null, 'key': 'composition_hooks' } - }); + }; holodeck.mock(new Response(200, body)); @@ -384,7 +384,7 @@ describe('CompositionHook', function() { ); it('should generate valid read_results response', function(done) { - var body = JSON.stringify({ + var body = { 'composition_hooks': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -448,7 +448,7 @@ describe('CompositionHook', function() { 'next_page_url': null, 'key': 'composition_hooks' } - }); + }; holodeck.mock(new Response(200, body)); @@ -463,7 +463,7 @@ describe('CompositionHook', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositionHooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -484,7 +484,7 @@ describe('CompositionHook', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); @@ -499,7 +499,7 @@ describe('CompositionHook', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.video.v1.compositionHooks.create(opts); @@ -522,7 +522,7 @@ describe('CompositionHook', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'friendly_name': 'My composition hook', 'enabled': false, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -564,7 +564,7 @@ describe('CompositionHook', function() { 'status_callback': 'http://www.example.com', 'status_callback_method': 'POST', 'url': 'https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -580,7 +580,7 @@ describe('CompositionHook', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.video.v1.compositionHooks('HKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); @@ -604,7 +604,7 @@ describe('CompositionHook', function() { ); it('should generate valid update_all_fields response', function(done) { - var body = JSON.stringify({ + var body = { 'friendly_name': 'My composition hook', 'enabled': true, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -646,7 +646,7 @@ describe('CompositionHook', function() { 'status_callback': 'http://www.example.com', 'status_callback_method': 'POST', 'url': 'https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -662,7 +662,7 @@ describe('CompositionHook', function() { ); it('should generate valid update_with_defaults response', function(done) { - var body = JSON.stringify({ + var body = { 'friendly_name': 'My composition hook', 'enabled': true, 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -683,7 +683,7 @@ describe('CompositionHook', function() { 'status_callback': null, 'status_callback_method': 'POST', 'url': 'https://video.twilio.com/v1/CompositionHooks/HKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/video/v1/compositionSettings.spec.js b/spec/integration/rest/video/v1/compositionSettings.spec.js index 116db89d0a..a7af00a357 100644 --- a/spec/integration/rest/video/v1/compositionSettings.spec.js +++ b/spec/integration/rest/video/v1/compositionSettings.spec.js @@ -31,7 +31,7 @@ describe('CompositionSettings', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.compositionSettings().fetch(); promise.then(function() { @@ -51,7 +51,7 @@ describe('CompositionSettings', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'string', 'aws_credentials_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -60,7 +60,7 @@ describe('CompositionSettings', function() { 'aws_storage_enabled': true, 'encryption_enabled': true, 'url': 'https://video.twilio.com/v1/CompositionSettings/Default' - }); + }; holodeck.mock(new Response(200, body)); @@ -75,7 +75,7 @@ describe('CompositionSettings', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.video.v1.compositionSettings().create(opts); @@ -98,7 +98,7 @@ describe('CompositionSettings', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'aws_credentials_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -107,7 +107,7 @@ describe('CompositionSettings', function() { 'aws_storage_enabled': true, 'encryption_enabled': true, 'url': 'https://video.twilio.com/v1/CompositionSettings/Default' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/video/v1/recording.spec.js b/spec/integration/rest/video/v1/recording.spec.js index e379a8ca7a..4aec724746 100644 --- a/spec/integration/rest/video/v1/recording.spec.js +++ b/spec/integration/rest/video/v1/recording.spec.js @@ -31,7 +31,7 @@ describe('Recording', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Recording', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'processing', 'date_created': '2015-07-30T20:00:00Z', @@ -76,7 +76,7 @@ describe('Recording', function() { 'links': { 'media': 'https://video.twilio.com/v1/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' } - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('Recording', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -129,14 +129,14 @@ describe('Recording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.recordings.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -174,7 +174,7 @@ describe('Recording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.recordings.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -186,7 +186,7 @@ describe('Recording', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -224,14 +224,14 @@ describe('Recording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.recordings.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.recordings.list(); promise.then(function() { @@ -251,7 +251,7 @@ describe('Recording', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [], 'meta': { 'page': 0, @@ -262,7 +262,7 @@ describe('Recording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); @@ -277,7 +277,7 @@ describe('Recording', function() { ); it('should generate valid read_results response', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -315,7 +315,7 @@ describe('Recording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); @@ -330,7 +330,7 @@ describe('Recording', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -351,7 +351,7 @@ describe('Recording', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/video/v1/recordingSettings.spec.js b/spec/integration/rest/video/v1/recordingSettings.spec.js index dfca8b548e..31127c13fa 100644 --- a/spec/integration/rest/video/v1/recordingSettings.spec.js +++ b/spec/integration/rest/video/v1/recordingSettings.spec.js @@ -31,7 +31,7 @@ describe('RecordingSettings', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.recordingSettings().fetch(); promise.then(function() { @@ -51,7 +51,7 @@ describe('RecordingSettings', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'string', 'aws_credentials_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -60,7 +60,7 @@ describe('RecordingSettings', function() { 'aws_storage_enabled': true, 'encryption_enabled': true, 'url': 'https://video.twilio.com/v1/RecordingSettings/Default' - }); + }; holodeck.mock(new Response(200, body)); @@ -75,7 +75,7 @@ describe('RecordingSettings', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {friendlyName: 'friendly_name'}; var promise = client.video.v1.recordingSettings().create(opts); @@ -98,7 +98,7 @@ describe('RecordingSettings', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'friendly_name': 'friendly_name', 'aws_credentials_sid': 'CRaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -107,7 +107,7 @@ describe('RecordingSettings', function() { 'aws_storage_enabled': true, 'encryption_enabled': true, 'url': 'https://video.twilio.com/v1/RecordingSettings/Default' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/video/v1/room.spec.js b/spec/integration/rest/video/v1/room.spec.js index 0a923d2d45..0c0a39be6e 100644 --- a/spec/integration/rest/video/v1/room.spec.js +++ b/spec/integration/rest/video/v1/room.spec.js @@ -31,7 +31,7 @@ describe('Room', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Room', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -76,7 +76,7 @@ describe('Room', function() { 'participants': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', 'recordings': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings' } - }); + }; holodeck.mock(new Response(200, body)); @@ -91,7 +91,7 @@ describe('Room', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms.create(); promise.then(function() { @@ -111,7 +111,7 @@ describe('Room', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -135,7 +135,7 @@ describe('Room', function() { 'participants': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', 'recordings': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings' } - }); + }; holodeck.mock(new Response(201, body)); @@ -150,7 +150,7 @@ describe('Room', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'rooms': [ { 'sid': 'RM4070b618362c1682b2385b1f9982833c', @@ -187,14 +187,14 @@ describe('Room', function() { 'next_page_url': null, 'key': 'rooms' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'rooms': [ { 'sid': 'RM4070b618362c1682b2385b1f9982833c', @@ -231,7 +231,7 @@ describe('Room', function() { 'next_page_url': null, 'key': 'rooms' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -243,7 +243,7 @@ describe('Room', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'rooms': [ { 'sid': 'RM4070b618362c1682b2385b1f9982833c', @@ -280,14 +280,14 @@ describe('Room', function() { 'next_page_url': null, 'key': 'rooms' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms.list(); promise.then(function() { @@ -307,7 +307,7 @@ describe('Room', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'rooms': [], 'meta': { 'page': 0, @@ -318,7 +318,7 @@ describe('Room', function() { 'next_page_url': null, 'key': 'rooms' } - }); + }; holodeck.mock(new Response(200, body)); @@ -333,7 +333,7 @@ describe('Room', function() { ); it('should generate valid read_with_status response', function(done) { - var body = JSON.stringify({ + var body = { 'rooms': [ { 'sid': 'RM4070b618362c1682b2385b1f9982833c', @@ -370,7 +370,7 @@ describe('Room', function() { 'next_page_url': null, 'key': 'rooms' } - }); + }; holodeck.mock(new Response(200, body)); @@ -385,7 +385,7 @@ describe('Room', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {status: 'in-progress'}; var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(opts); @@ -409,7 +409,7 @@ describe('Room', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -433,7 +433,7 @@ describe('Room', function() { 'participants': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants', 'recordings': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/video/v1/room/recording.spec.js b/spec/integration/rest/video/v1/room/recording.spec.js index 16fdbc892f..c89953d1b4 100644 --- a/spec/integration/rest/video/v1/room/recording.spec.js +++ b/spec/integration/rest/video/v1/room/recording.spec.js @@ -31,7 +31,7 @@ describe('RoomRecording', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('RoomRecording', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'status': 'processing', 'date_created': '2015-07-30T20:00:00Z', @@ -79,7 +79,7 @@ describe('RoomRecording', function() { 'links': { 'media': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Recordings/RTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Media' } - }); + }; holodeck.mock(new Response(200, body)); @@ -95,7 +95,7 @@ describe('RoomRecording', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -134,7 +134,7 @@ describe('RoomRecording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each(() => done()); @@ -142,7 +142,7 @@ describe('RoomRecording', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -181,7 +181,7 @@ describe('RoomRecording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each({pageSize: 20}, () => done()); @@ -194,7 +194,7 @@ describe('RoomRecording', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -233,7 +233,7 @@ describe('RoomRecording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.each({callback: () => done()}, () => fail('wrong callback!')); @@ -241,7 +241,7 @@ describe('RoomRecording', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings.list(); @@ -263,7 +263,7 @@ describe('RoomRecording', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [], 'meta': { 'page': 0, @@ -274,7 +274,7 @@ describe('RoomRecording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); @@ -290,7 +290,7 @@ describe('RoomRecording', function() { ); it('should generate valid read_results response', function(done) { - var body = JSON.stringify({ + var body = { 'recordings': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -329,7 +329,7 @@ describe('RoomRecording', function() { 'next_page_url': null, 'key': 'recordings' } - }); + }; holodeck.mock(new Response(200, body)); @@ -345,7 +345,7 @@ describe('RoomRecording', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .recordings('RTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); @@ -368,7 +368,7 @@ describe('RoomRecording', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/video/v1/room/roomParticipant.spec.js b/spec/integration/rest/video/v1/room/roomParticipant.spec.js index a381a43606..6970544497 100644 --- a/spec/integration/rest/video/v1/room/roomParticipant.spec.js +++ b/spec/integration/rest/video/v1/room/roomParticipant.spec.js @@ -31,7 +31,7 @@ describe('Participant', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); @@ -54,7 +54,7 @@ describe('Participant', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', @@ -71,7 +71,7 @@ describe('Participant', function() { 'subscribed_tracks': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks', 'subscribe_rules': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribeRules' } - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('Participant', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -117,7 +117,7 @@ describe('Participant', function() { 'next_page_url': null, 'key': 'participants' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each(() => done()); @@ -125,7 +125,7 @@ describe('Participant', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -155,7 +155,7 @@ describe('Participant', function() { 'next_page_url': null, 'key': 'participants' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each({pageSize: 20}, () => done()); @@ -168,7 +168,7 @@ describe('Participant', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -198,7 +198,7 @@ describe('Participant', function() { 'next_page_url': null, 'key': 'participants' } - }); + }; holodeck.mock(new Response(200, body)); client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.each({callback: () => done()}, () => fail('wrong callback!')); @@ -206,7 +206,7 @@ describe('Participant', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants.list(); @@ -228,7 +228,7 @@ describe('Participant', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [], 'meta': { 'page': 0, @@ -239,7 +239,7 @@ describe('Participant', function() { 'next_page_url': null, 'key': 'participants' } - }); + }; holodeck.mock(new Response(200, body)); @@ -255,7 +255,7 @@ describe('Participant', function() { ); it('should generate valid read_filters response', function(done) { - var body = JSON.stringify({ + var body = { 'participants': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -285,7 +285,7 @@ describe('Participant', function() { 'next_page_url': null, 'key': 'participants' } - }); + }; holodeck.mock(new Response(200, body)); @@ -301,7 +301,7 @@ describe('Participant', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); @@ -324,7 +324,7 @@ describe('Participant', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2017-07-30T20:00:00Z', @@ -341,7 +341,7 @@ describe('Participant', function() { 'subscribed_tracks': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks', 'subscribe_rules': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribeRules' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.spec.js b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.spec.js index 76a36467d3..39a38e7c9f 100644 --- a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.spec.js +++ b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantPublishedTrack.spec.js @@ -31,7 +31,7 @@ describe('PublishedTrack', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('PublishedTrack', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -66,7 +66,7 @@ describe('PublishedTrack', function() { 'kind': 'data', 'enabled': true, 'url': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/PublishedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('PublishedTrack', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -107,7 +107,7 @@ describe('PublishedTrack', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'published_tracks': [], 'meta': { 'page': 0, @@ -118,7 +118,7 @@ describe('PublishedTrack', function() { 'next_page_url': null, 'key': 'published_tracks' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribeRule.spec.js b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribeRule.spec.js index e564d0c2a4..3f0c1e6b2f 100644 --- a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribeRule.spec.js +++ b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribeRule.spec.js @@ -31,7 +31,7 @@ describe('SubscribeRules', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -55,7 +55,7 @@ describe('SubscribeRules', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'participant_sid': 'PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': null, @@ -70,7 +70,7 @@ describe('SubscribeRules', function() { 'priority': null } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -87,7 +87,7 @@ describe('SubscribeRules', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -111,7 +111,7 @@ describe('SubscribeRules', function() { ); it('should generate valid update_filters response', function(done) { - var body = JSON.stringify({ + var body = { 'participant_sid': 'PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': null, @@ -126,7 +126,7 @@ describe('SubscribeRules', function() { 'priority': null } ] - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.spec.js b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.spec.js index 89cbae5f12..6b8e317369 100644 --- a/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.spec.js +++ b/spec/integration/rest/video/v1/room/roomParticipant/roomParticipantSubscribedTrack.spec.js @@ -31,7 +31,7 @@ describe('SubscribedTrack', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -56,7 +56,7 @@ describe('SubscribedTrack', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'room_sid': 'RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'date_created': '2015-07-30T20:00:00Z', 'date_updated': '2015-07-30T20:00:00Z', @@ -67,7 +67,7 @@ describe('SubscribedTrack', function() { 'kind': 'data', 'enabled': true, 'url': 'https://video.twilio.com/v1/Rooms/RMaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Participants/PAaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/SubscribedTracks/MTaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -84,7 +84,7 @@ describe('SubscribedTrack', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.video.v1.rooms('RMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .participants('PAXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') @@ -108,7 +108,7 @@ describe('SubscribedTrack', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'subscribed_tracks': [], 'meta': { 'page': 0, @@ -119,7 +119,7 @@ describe('SubscribedTrack', function() { 'next_page_url': null, 'key': 'subscribed_tracks' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/voice/v1/dialingPermissions/bulkCountryUpdate.spec.js b/spec/integration/rest/voice/v1/dialingPermissions/bulkCountryUpdate.spec.js index 758670f079..df10316379 100644 --- a/spec/integration/rest/voice/v1/dialingPermissions/bulkCountryUpdate.spec.js +++ b/spec/integration/rest/voice/v1/dialingPermissions/bulkCountryUpdate.spec.js @@ -31,7 +31,7 @@ describe('BulkCountryUpdate', function() { }); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {updateRequest: 'update_request'}; var promise = client.voice.v1.dialingPermissions @@ -55,10 +55,10 @@ describe('BulkCountryUpdate', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'update_count': 1, 'update_request': 'accepted' - }); + }; holodeck.mock(new Response(201, body)); diff --git a/spec/integration/rest/voice/v1/dialingPermissions/country.spec.js b/spec/integration/rest/voice/v1/dialingPermissions/country.spec.js index 55d4ea0f6a..2f3974d890 100644 --- a/spec/integration/rest/voice/v1/dialingPermissions/country.spec.js +++ b/spec/integration/rest/voice/v1/dialingPermissions/country.spec.js @@ -31,7 +31,7 @@ describe('Country', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.voice.v1.dialingPermissions .countries('US').fetch(); @@ -53,7 +53,7 @@ describe('Country', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'iso_code': 'US', 'name': 'United States/Canada', 'country_codes': [ @@ -67,7 +67,7 @@ describe('Country', function() { 'links': { 'highrisk_special_prefixes': 'https://voice.twilio.com/v1/DialingPermissions/Countries/US/HighRiskSpecialPrefixes' } - }); + }; holodeck.mock(new Response(200, body)); @@ -83,7 +83,7 @@ describe('Country', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'iso_code': 'US', @@ -110,7 +110,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries.each(() => done()); @@ -118,7 +118,7 @@ describe('Country', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'iso_code': 'US', @@ -145,7 +145,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries.each({pageSize: 20}, () => done()); @@ -158,7 +158,7 @@ describe('Country', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'iso_code': 'US', @@ -185,7 +185,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries.each({callback: () => done()}, () => fail('wrong callback!')); @@ -193,7 +193,7 @@ describe('Country', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.voice.v1.dialingPermissions .countries.list(); @@ -214,7 +214,7 @@ describe('Country', function() { ); it('should generate valid read_us response', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'iso_code': 'US', @@ -241,7 +241,7 @@ describe('Country', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries?IsoCode=US&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.spec.js b/spec/integration/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.spec.js index 5f238692cd..cdaaadee99 100644 --- a/spec/integration/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.spec.js +++ b/spec/integration/rest/voice/v1/dialingPermissions/country/highriskSpecialPrefix.spec.js @@ -31,7 +31,7 @@ describe('HighriskSpecialPrefix', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'prefix': '+37181' @@ -49,7 +49,7 @@ describe('HighriskSpecialPrefix', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries/LV/HighRiskSpecialPrefixes?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries('US') @@ -58,7 +58,7 @@ describe('HighriskSpecialPrefix', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'prefix': '+37181' @@ -76,7 +76,7 @@ describe('HighriskSpecialPrefix', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries/LV/HighRiskSpecialPrefixes?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries('US') @@ -90,7 +90,7 @@ describe('HighriskSpecialPrefix', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'prefix': '+37181' @@ -108,7 +108,7 @@ describe('HighriskSpecialPrefix', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries/LV/HighRiskSpecialPrefixes?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.voice.v1.dialingPermissions .countries('US') @@ -117,7 +117,7 @@ describe('HighriskSpecialPrefix', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.voice.v1.dialingPermissions .countries('US') @@ -140,7 +140,7 @@ describe('HighriskSpecialPrefix', function() { ); it('should generate valid read_lv response', function(done) { - var body = JSON.stringify({ + var body = { 'content': [ { 'prefix': '+37181' @@ -158,7 +158,7 @@ describe('HighriskSpecialPrefix', function() { 'previous_page_url': null, 'url': 'https://voice.twilio.com/v1/DialingPermissions/Countries/LV/HighRiskSpecialPrefixes?PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/voice/v1/dialingPermissions/settings.spec.js b/spec/integration/rest/voice/v1/dialingPermissions/settings.spec.js index ad3141d90a..d3e20f27ea 100644 --- a/spec/integration/rest/voice/v1/dialingPermissions/settings.spec.js +++ b/spec/integration/rest/voice/v1/dialingPermissions/settings.spec.js @@ -31,7 +31,7 @@ describe('Settings', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.voice.v1.dialingPermissions .settings().fetch(); @@ -52,10 +52,10 @@ describe('Settings', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'dialing_permissions_inheritance': true, 'url': 'https://voice.twilio.com/v1/Settings' - }); + }; holodeck.mock(new Response(200, body)); @@ -71,7 +71,7 @@ describe('Settings', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.voice.v1.dialingPermissions .settings().update(); @@ -92,10 +92,10 @@ describe('Settings', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'dialing_permissions_inheritance': true, 'url': 'https://voice.twilio.com/v1/Settings' - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/wireless/v1/command.spec.js b/spec/integration/rest/wireless/v1/command.spec.js index 49e88ff40a..30b384b369 100644 --- a/spec/integration/rest/wireless/v1/command.spec.js +++ b/spec/integration/rest/wireless/v1/command.spec.js @@ -31,7 +31,7 @@ describe('Command', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.commands('DCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Command', function() { ); it('should generate valid fetch_command_sms response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'text', @@ -65,7 +65,7 @@ describe('Command', function() { 'status': 'queued', 'transport': 'sms', 'url': 'https://wireless.twilio.com/v1/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -80,7 +80,7 @@ describe('Command', function() { ); it('should generate valid fetch_command_ip response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'text', @@ -93,7 +93,7 @@ describe('Command', function() { 'status': 'queued', 'transport': 'ip', 'url': 'https://wireless.twilio.com/v1/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -108,7 +108,7 @@ describe('Command', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -134,14 +134,14 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.commands.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -167,7 +167,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.commands.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -179,7 +179,7 @@ describe('Command', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -205,14 +205,14 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.commands.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.commands.list(); promise.then(function() { @@ -232,7 +232,7 @@ describe('Command', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [], 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0', @@ -243,7 +243,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -258,7 +258,7 @@ describe('Command', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -284,7 +284,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=from_sim&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -299,7 +299,7 @@ describe('Command', function() { ); it('should generate valid read_ip response', function(done) { - var body = JSON.stringify({ + var body = { 'commands': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -325,7 +325,7 @@ describe('Command', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Commands?Status=queued&Direction=to_sim&Transport=ip&Sim=sim&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -340,7 +340,7 @@ describe('Command', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var opts = {command: 'command'}; var promise = client.wireless.v1.commands.create(opts); @@ -363,7 +363,7 @@ describe('Command', function() { ); it('should generate valid create_command_sms response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'text', @@ -376,7 +376,7 @@ describe('Command', function() { 'status': 'queued', 'transport': 'sms', 'url': 'https://wireless.twilio.com/v1/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -392,7 +392,7 @@ describe('Command', function() { ); it('should generate valid create_command_ip response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'command': 'command', 'command_mode': 'binary', @@ -405,7 +405,7 @@ describe('Command', function() { 'status': 'queued', 'transport': 'ip', 'url': 'https://wireless.twilio.com/v1/Commands/DCaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -421,7 +421,7 @@ describe('Command', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.commands('DCXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -442,7 +442,7 @@ describe('Command', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/wireless/v1/ratePlan.spec.js b/spec/integration/rest/wireless/v1/ratePlan.spec.js index 91f3022403..1700bbc872 100644 --- a/spec/integration/rest/wireless/v1/ratePlan.spec.js +++ b/spec/integration/rest/wireless/v1/ratePlan.spec.js @@ -31,7 +31,7 @@ describe('RatePlan', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -68,14 +68,14 @@ describe('RatePlan', function() { 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.ratePlans.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -112,7 +112,7 @@ describe('RatePlan', function() { 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.ratePlans.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -124,7 +124,7 @@ describe('RatePlan', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -161,14 +161,14 @@ describe('RatePlan', function() { 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.ratePlans.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.ratePlans.list(); promise.then(function() { @@ -188,7 +188,7 @@ describe('RatePlan', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -199,7 +199,7 @@ describe('RatePlan', function() { 'url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0' }, 'rate_plans': [] - }); + }; holodeck.mock(new Response(200, body)); @@ -214,7 +214,7 @@ describe('RatePlan', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/RatePlans?PageSize=50&Page=0', 'key': 'rate_plans', @@ -251,7 +251,7 @@ describe('RatePlan', function() { 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' } ] - }); + }; holodeck.mock(new Response(200, body)); @@ -266,7 +266,7 @@ describe('RatePlan', function() { ); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -287,7 +287,7 @@ describe('RatePlan', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -311,7 +311,7 @@ describe('RatePlan', function() { 'usage_notification_url': 'https://callback.com', 'data_limit_strategy': 'block', 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -326,7 +326,7 @@ describe('RatePlan', function() { ); it('should generate valid create request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.ratePlans.create(); promise.then(function() { @@ -346,7 +346,7 @@ describe('RatePlan', function() { ); it('should generate valid create response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -370,7 +370,7 @@ describe('RatePlan', function() { 'usage_notification_method': 'POST', 'usage_notification_url': 'https://callback.com', 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(201, body)); @@ -385,7 +385,7 @@ describe('RatePlan', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -406,7 +406,7 @@ describe('RatePlan', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'data_enabled': true, @@ -430,7 +430,7 @@ describe('RatePlan', function() { 'usage_notification_url': 'https://callback.com', 'data_limit_strategy': 'block', 'url': 'https://wireless.twilio.com/v1/RatePlans/WPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' - }); + }; holodeck.mock(new Response(200, body)); @@ -445,7 +445,7 @@ describe('RatePlan', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.ratePlans('WPXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -466,7 +466,7 @@ describe('RatePlan', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/wireless/v1/sim.spec.js b/spec/integration/rest/wireless/v1/sim.spec.js index 31dff8071e..874ee89f8a 100644 --- a/spec/integration/rest/wireless/v1/sim.spec.js +++ b/spec/integration/rest/wireless/v1/sim.spec.js @@ -31,7 +31,7 @@ describe('Sim', function() { }); it('should generate valid fetch request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').fetch(); promise.then(function() { @@ -52,7 +52,7 @@ describe('Sim', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -81,7 +81,7 @@ describe('Sim', function() { 'reset_status': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'ip_address': '192.168.1.1' - }); + }; holodeck.mock(new Response(200, body)); @@ -96,7 +96,7 @@ describe('Sim', function() { ); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -138,14 +138,14 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -187,7 +187,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -199,7 +199,7 @@ describe('Sim', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -241,14 +241,14 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims.list(); promise.then(function() { @@ -268,7 +268,7 @@ describe('Sim', function() { ); it('should generate valid read_empty response', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [], 'meta': { 'first_page_url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0', @@ -279,7 +279,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -294,7 +294,7 @@ describe('Sim', function() { ); it('should generate valid read_full response', function(done) { - var body = JSON.stringify({ + var body = { 'sims': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -336,7 +336,7 @@ describe('Sim', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims?Status=new&Iccid=iccid&RatePlan=rate_plan&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); @@ -351,7 +351,7 @@ describe('Sim', function() { ); it('should generate valid update request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').update(); promise.then(function() { @@ -372,7 +372,7 @@ describe('Sim', function() { ); it('should generate valid update response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -401,7 +401,7 @@ describe('Sim', function() { 'voice_url': 'http://www.example.com', 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'ip_address': '192.168.1.30' - }); + }; holodeck.mock(new Response(200, body)); @@ -416,7 +416,7 @@ describe('Sim', function() { ); it('should generate valid update_move_to_subaccount response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -445,7 +445,7 @@ describe('Sim', function() { 'voice_url': 'http://www.example.com', 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'ip_address': '192.168.1.30' - }); + }; holodeck.mock(new Response(200, body)); @@ -460,7 +460,7 @@ describe('Sim', function() { ); it('should generate valid update_reset_connectivity response', function(done) { - var body = JSON.stringify({ + var body = { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'unique_name': 'unique_name', 'commands_callback_method': 'http_method', @@ -489,7 +489,7 @@ describe('Sim', function() { 'voice_url': 'http://www.example.com', 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', 'ip_address': '192.168.1.30' - }); + }; holodeck.mock(new Response(200, body)); @@ -504,7 +504,7 @@ describe('Sim', function() { ); it('should generate valid remove request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX').remove(); promise.then(function() { @@ -525,7 +525,7 @@ describe('Sim', function() { ); it('should generate valid delete response', function(done) { - var body = JSON.stringify(null); + var body = null; holodeck.mock(new Response(204, body)); diff --git a/spec/integration/rest/wireless/v1/sim/dataSession.spec.js b/spec/integration/rest/wireless/v1/sim/dataSession.spec.js index e45d7f691f..95447a67b6 100644 --- a/spec/integration/rest/wireless/v1/sim/dataSession.spec.js +++ b/spec/integration/rest/wireless/v1/sim/dataSession.spec.js @@ -31,7 +31,7 @@ describe('DataSession', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'data_sessions': [ { 'sid': 'WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -79,7 +79,7 @@ describe('DataSession', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dataSessions.each(() => done()); @@ -87,7 +87,7 @@ describe('DataSession', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'data_sessions': [ { 'sid': 'WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -135,7 +135,7 @@ describe('DataSession', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dataSessions.each({pageSize: 20}, () => done()); @@ -148,7 +148,7 @@ describe('DataSession', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'data_sessions': [ { 'sid': 'WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -196,7 +196,7 @@ describe('DataSession', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dataSessions.each({callback: () => done()}, () => fail('wrong callback!')); @@ -204,7 +204,7 @@ describe('DataSession', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .dataSessions.list(); @@ -226,7 +226,7 @@ describe('DataSession', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'data_sessions': [ { 'sid': 'WNaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -274,7 +274,7 @@ describe('DataSession', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/DataSessions?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js b/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js index 21c142df09..25b9766ba6 100644 --- a/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js +++ b/spec/integration/rest/wireless/v1/sim/usageRecord.spec.js @@ -31,7 +31,7 @@ describe('UsageRecord', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -105,7 +105,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usageRecords.each(() => done()); @@ -113,7 +113,7 @@ describe('UsageRecord', function() { ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -187,7 +187,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usageRecords.each({pageSize: 20}, () => done()); @@ -200,7 +200,7 @@ describe('UsageRecord', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -274,7 +274,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usageRecords.each({callback: () => done()}, () => fail('wrong callback!')); @@ -282,7 +282,7 @@ describe('UsageRecord', function() { ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.sims('DEXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX') .usageRecords.list(); @@ -304,7 +304,7 @@ describe('UsageRecord', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -378,7 +378,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/Sims/DEaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); diff --git a/spec/integration/rest/wireless/v1/usageRecord.spec.js b/spec/integration/rest/wireless/v1/usageRecord.spec.js index 48565cd2c1..4e278e3db9 100644 --- a/spec/integration/rest/wireless/v1/usageRecord.spec.js +++ b/spec/integration/rest/wireless/v1/usageRecord.spec.js @@ -31,7 +31,7 @@ describe('UsageRecord', function() { }); it('should treat the first each arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -103,14 +103,14 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.usageRecords.each(() => done()); } ); it('should treat the second arg as a callback', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -182,7 +182,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.usageRecords.each({pageSize: 20}, () => done()); holodeck.assertHasRequest(new Request({ @@ -194,7 +194,7 @@ describe('UsageRecord', function() { ); it('should find the callback in the opts object', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -266,14 +266,14 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body)); client.wireless.v1.usageRecords.each({callback: () => done()}, () => fail('wrong callback!')); } ); it('should generate valid list request', function(done) { - holodeck.mock(new Response(500, '{}')); + holodeck.mock(new Response(500, {})); var promise = client.wireless.v1.usageRecords.list(); promise.then(function() { @@ -293,7 +293,7 @@ describe('UsageRecord', function() { ); it('should generate valid fetch response', function(done) { - var body = JSON.stringify({ + var body = { 'usage_records': [ { 'account_sid': 'ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa', @@ -365,7 +365,7 @@ describe('UsageRecord', function() { 'previous_page_url': null, 'url': 'https://wireless.twilio.com/v1/UsageRecords?Start=2015-07-30T20%3A00%3A00Z&End=2015-07-30T20%3A00%3A00Z&PageSize=50&Page=0' } - }); + }; holodeck.mock(new Response(200, body));