Commit aac1161b by AdriVanHoudt

Added tests for company api

parent 4f6d5453
......@@ -15,7 +15,7 @@ function Company(api) {
}
/**
* Retriece company information by domain
* Retrieve company information by domain
*
* ```js
* fullcontact.company.domain('apple.com', [webhookUrl], [webhookId], fn);
......@@ -24,7 +24,7 @@ function Company(api) {
* @returns {Company}
* @api public
*/
Company.prototype.domain = function disposable() {
Company.prototype.domain = function domain() {
var args = this.api.args(arguments, 'webhookUrl', 'webhookId');
this.send({ domain: args.value }, args);
......
describe('FullContact.Company', function () {
'use strict';
var FullContact = require('../');
var chai = require('chai');
chai.config.includeStack = true;
//
// The API key we use for testing.
//
var key = process.env.API_KEY;
if (!key) {
throw new Error('Please provide your API using the API_KEY env variable.');
}
//
// Some of the requests take a really long time, so set a really long timeout
//
this.timeout(20000);
//
// Pre-create an API instance
//
var api = new FullContact(key);
describe('#domain', function () {
it('retrieves data by domain', function (done) {
api.company.domain('apple.com', done);
});
it('provides the proper casing');
});
describe('#domain 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.company.domain('apple.com', 'http://requestb.in/1bxgb751', 'webhookTest', 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