Last active
August 29, 2015 13:57
-
-
Save stefanjudis/9621026 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fancyApiKey; | |
casper.test.begin('curl_post_client', function suite ( test ) { | |
'use strict'; | |
var url = "http://projecta:[email protected]/api/v1/client/"; | |
var email = "[email protected]"; | |
var passwort = "1234"; | |
var remote_addr = "127.0.0.1"; | |
var sub = "1"; | |
var cl_st = "REGISTERED"; | |
casper.start(url); | |
var settings = { | |
method: 'post', | |
headers: { | |
'Content-Type': 'application/json', | |
'Accept' : 'application/json', | |
'api_key' : 'testApiKey', | |
'token' : 'testtoken' | |
}, | |
data: JSON.stringify( { | |
'email': email, | |
'password' : passwort, | |
'remote_addr': remote_addr, | |
'subscription_plan_id': sub, | |
'client_status': cl_st | |
} ) | |
}; | |
casper.then(function(){ | |
casper.open(url, settings); | |
casper.then(function() { | |
this.echo(this.evaluate(function(){ | |
return __utils__.findOne('body pre').textContent.trim(); | |
})); | |
}); | |
}); | |
casper.run( function () { | |
casper.test.done(); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment