Skip to content

Instantly share code, notes, and snippets.

@mmcc
Created December 11, 2014 21:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mmcc/9d75cecd0ddfec88e5dc to your computer and use it in GitHub Desktop.
Save mmcc/9d75cecd0ddfec88e5dc to your computer and use it in GitHub Desktop.
chain smoker example config
var Suite = {};
function getRandomInt(min, max) {
return Math.floor(Math.random() * (max - min)) + min;
}
Suite.tests = [
{
name: 'Test Delivery',
address: 'http://www.example.com/accounts/'+ getRandomInt(100, 999) +'/subscriptions',
method: 'POST',
body: {
endpoint: this.callbackAddress,
events: ['herp', 'derp']
},
assertions: {
statusCode: 201
},
callback_assertions: {
job: {
state: 'finished'
}
}
},
{
name: 'Example get',
address: 'http://example.com',
assertions: {
statusCode: 200
}
},
{
name: 'zc-create-job',
address: 'https://app.zencoder.com/api/v2/jobs',
method: 'POST',
external_id: function(body) {
return body.job.id;
},
headers: {
'zencoder-api-key': '12345'
},
body: {
input: 'http://s3.amazonaws.com/zencodertesting/test.mov',
notifications: 'https://25427b35.ngrok.com/callback/zc-create-job'
},
assertions: {
statusCode: 201
},
callback_assertions: {
job: {
state: 'finished'
}
}
}
];
module.exports = Suite;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment