Commit 77c919cb by 3rd-Eden

[test] Added more tests for the person API's

parent f7b55e5d
......@@ -88,7 +88,10 @@ describe('FullContact', function () {
api.person.email('arnout@observe.it', function email(err) {
if (err) return done(err);
expect(api.remaining).to.be.below(remaining);
//
// The value should be same as before or below
//
expect(api.remaining).to.be.below(remaining + 1);
done();
});
});
......
......@@ -17,33 +17,51 @@ describe('FullContact.Person', function () {
//
this.timeout(20000);
//
// Pre-create an API instance
//
var api = new FullContact(key);
describe('#email', function () {
it('retrieves data by e-mail');
it('provides the proper casing');
});
it('retrieves data by e-mail', function (done) {
api.person.email('arnout@observe.it', done);
});
describe('#md5', function () {
it('retrieves data by md5 e-mail');
it('provides the proper casing');
});
describe('#md5', function () {
it('retrieves data by md5 e-mail');
var md5 = require('crypto').createHash('md5')
.update('arnout@observe.it')
.digest('hex')
.toString();
it('retrieves data by md5 e-mail', function (done) {
api.person.md5(md5, done);
});
it('provides the proper casing');
});
describe('#twitter', function () {
it('retrieves data by twitter handle');
it('retrieves data by twitter handle', function (done) {
api.person.twitter('observe_it', done);
});
it('provides the proper casing');
});
describe('#facebook', function () {
it('retrieves data by facebook username');
it('retrieves data by facebook username', function (done) {
api.person.facebook('arnout.kazemier', done);
});
it('provides the proper casing');
});
describe('#phone', function () {
it('retrieves data by phone number');
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