Commit f541e3a8 by Ben Drucker

Provide a person#pending method for parity with the ruby lib

parent d5516615
......@@ -8,6 +8,10 @@ module.exports = function (client) {
_.extend(this, data);
}
Person.prototype.pending = function () {
return !this.id;
};
Person.find = function (options) {
assert(options && options.email, 'An email must be provided');
return this.client.request(_.extend({
......
......@@ -18,6 +18,17 @@ describe('Person', function () {
mock.done();
});
describe('#pending', function () {
it('identifies whether the person has an id', function () {
var person = new Person();
expect(person.pending()).to.be.true;
person.id = 'foo';
expect(person.pending()).to.be.false;
});
});
describe('Person#find', function () {
it('can find a person by email', function () {
......
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