Skip to content

Instantly share code, notes, and snippets.

@armandomiani
Created June 8, 2015 19:20
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 armandomiani/d19bcb6ad9001191b71b to your computer and use it in GitHub Desktop.
Save armandomiani/d19bcb6ad9001191b71b to your computer and use it in GitHub Desktop.
var createJob = function(callback) {
var url = get_service_url('', '/rest/v1/job/create');
var params = {
'contact_email': 'armando.miani@i-value.com.br',
'contact_name': 'Armando Miani',
'contact_phone': '19999385915',
'address': 'Alameda Franca, 1222, Jardim Paulista, São Paulo',
'description': 'I want nice pictures or else I will not pay.',
'schedules': '2015-06-13 10:00:00, 2015-06-15 12:00:00, 2015-06-17 14:00:00',
'origin_id': '666'
};
frisby.create('Create job')
.post(url, params)
.expectStatus(200)
.expectHeaderContains('Content-type', 'application/json')
.afterJSON(function(result) {
if (typeof(callback) === "function") callback(result);
})
.toss();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment