Commit 00b73d42 by AdriVanHoudt

add support for webhook url/id on person.email and added a test

parent 03a7ad80
......@@ -25,7 +25,7 @@ function Person(api) {
* @api public
*/
Person.prototype.email = function email() {
var args = this.api.args(arguments, 'queue');
var args = this.api.args(arguments, 'queue', 'webhookUrl', 'webhookId');
this.send({ email: args.value }, args);
return this;
......
......@@ -45,6 +45,8 @@ FullContact.prototype.process = function req(api, query, args) {
if (args.queue) query.queue = args.queue;
if (args.casing) query.casing = args.casing;
if (args.population) query.includeZeroPopulation = !!args.population;
if (args.webhookUrl) query.webhookUrl = args.webhookUrl;
if (args.webhookId) query.webhookId = args.webhookId;
//
// The packet that is send to the server or queued when we are in queuing
......
......@@ -29,12 +29,20 @@ describe('FullContact.Person', function () {
it('provides the proper casing');
});
describe('#email with webhook url/id', function () {
it('retrieves data by e-mail and sets up a webhook with the right url and id', function (done) {
api.person.email('arnout@observe.it', null, 'http://requestb.in/1bxgb751', 'webhookTest', done);
});
it('provides the proper casing');
});
describe('#md5', function () {
var md5 = require('crypto').createHash('md5')
.update('arnout@observe.it')
.digest('hex')
.toString();
.toString();
it('retrieves data by md5 e-mail', function (done) {
api.person.md5(md5, done);
......@@ -68,7 +76,9 @@ describe('FullContact.Person', function () {
});
describe('#phone', function () {
it('retrieves data by phone number');
it('retrieves data by phone number', function (done) {
api.person.phone('+13037170414', done);
});
it('provides the proper casing');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment