Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
clearbit
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
prospector
clearbit
Commits
f541e3a8
Commit
f541e3a8
authored
Oct 09, 2014
by
Ben Drucker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Provide a person#pending method for parity with the ruby lib
parent
d5516615
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
person.js
src/person.js
+4
-0
person.js
test/person.js
+11
-0
No files found.
src/person.js
View file @
f541e3a8
...
...
@@ -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
({
...
...
test/person.js
View file @
f541e3a8
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment