angellist_api 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG.md +6 -0
- data/lib/angellist_api/client/startup_roles.rb +23 -5
- data/lib/angellist_api/client/startups.rb +20 -0
- data/lib/angellist_api/client/users.rb +15 -0
- data/lib/angellist_api/version.rb +1 -1
- data/spec/fixtures/cassettes/startup_roles.yml +2300 -1
- data/spec/fixtures/cassettes/startups.yml +601 -1
- data/spec/fixtures/cassettes/users.yml +520 -1
- data/spec/integration/startup_roles_spec.rb +36 -1
- data/spec/integration/startups_spec.rb +16 -0
- data/spec/integration/users_spec.rb +8 -0
- data/spec/spec_helper.rb +1 -0
- metadata +4 -4
@@ -3,7 +3,6 @@ require 'spec_helper'
|
|
3
3
|
describe AngellistApi::Client::StartupRoles,
|
4
4
|
:vcr => { :cassette_name => 'startup_roles' } do
|
5
5
|
|
6
|
-
ROLES = %w[founder employee past_investor advisor incubator referrer]
|
7
6
|
let(:client) { AngellistApi::Client.new }
|
8
7
|
|
9
8
|
it "gets a startup's relationships" do
|
@@ -21,5 +20,41 @@ describe AngellistApi::Client::StartupRoles,
|
|
21
20
|
end
|
22
21
|
roles.startup_roles.first.should have_key :startup
|
23
22
|
end
|
23
|
+
|
24
|
+
context 'when opting into the v1 version of the resource' do
|
25
|
+
let(:base_params) { { :v => 1 } }
|
26
|
+
|
27
|
+
it "gets a startup's outgoing relationships" do
|
28
|
+
params = { :startup_id => 1124 }.merge(base_params)
|
29
|
+
roles = client.get_startup_roles(params)
|
30
|
+
roles.startup_roles.each do |relationship|
|
31
|
+
ROLES.should include relationship.role
|
32
|
+
end
|
33
|
+
roles.startup_roles.first.should have_key :tagged
|
34
|
+
roles.startup_roles.first.tagged.should have_key :type
|
35
|
+
roles.startup_roles.first.tagged.type.should eq "User"
|
36
|
+
end
|
37
|
+
|
38
|
+
it "gets a startup's incoming relationships" do
|
39
|
+
params = { :startup_id => 1124, :direction => 'incoming' }.merge(base_params)
|
40
|
+
roles = client.get_startup_roles(params)
|
41
|
+
roles.startup_roles.each do |relationship|
|
42
|
+
ROLES.should include relationship.role
|
43
|
+
end
|
44
|
+
roles.startup_roles.first.should have_key :tagged
|
45
|
+
roles.startup_roles.first.tagged.should have_key :type
|
46
|
+
roles.startup_roles.first.tagged.type.should eq "User"
|
47
|
+
end
|
48
|
+
|
49
|
+
it "gets a user's relationships" do
|
50
|
+
params = { :user_id => 2850 }.merge(base_params)
|
51
|
+
roles = client.get_startup_roles(params)
|
52
|
+
roles.startup_roles.each do |relationship|
|
53
|
+
ROLES.should include relationship.role
|
54
|
+
end
|
55
|
+
roles.startup_roles.first.should have_key :startup
|
56
|
+
roles.startup_roles.first.should have_key :tagged
|
57
|
+
end
|
58
|
+
end
|
24
59
|
end
|
25
60
|
|
@@ -32,5 +32,21 @@ describe AngellistApi::Client::Startups,
|
|
32
32
|
startup = client.startup_search(:domain => '500.co')
|
33
33
|
startup.angellist_url.should eq 'http://angel.co/500-startups-fund'
|
34
34
|
end
|
35
|
+
|
36
|
+
it 'gets a company\s startup roles' do
|
37
|
+
roles = client.startup_roles(1124)
|
38
|
+
roles.startup_roles.size.should be > 0
|
39
|
+
roles.startup_roles.each do |relationship|
|
40
|
+
ROLES.should include relationship.role
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
it 'gets a company\s outgoing startup roles' do
|
45
|
+
roles = client.startup_roles(1124)
|
46
|
+
roles.startup_roles.size.should be > 0
|
47
|
+
roles.startup_roles.each do |relationship|
|
48
|
+
ROLES.should include relationship.role
|
49
|
+
end
|
50
|
+
end
|
35
51
|
end
|
36
52
|
|
@@ -19,5 +19,13 @@ describe AngellistApi::Client::Users,
|
|
19
19
|
user = client.user_search(:slug => '500startups')
|
20
20
|
user.linkedin_url.should eq 'http://www.linkedin.com/company/500-startups'
|
21
21
|
end
|
22
|
+
|
23
|
+
it 'gets the companies that a user has been tagged in' do
|
24
|
+
roles = client.user_roles(2850)
|
25
|
+
roles.startup_roles.size.should be > 0
|
26
|
+
roles.startup_roles.each do |relationship|
|
27
|
+
ROLES.should include relationship.role
|
28
|
+
end
|
29
|
+
end
|
22
30
|
end
|
23
31
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angellist_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-03-
|
13
|
+
date: 2013-03-25 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: hashie
|
@@ -285,7 +285,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
285
285
|
version: '0'
|
286
286
|
segments:
|
287
287
|
- 0
|
288
|
-
hash:
|
288
|
+
hash: 3302315814162737561
|
289
289
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
290
290
|
none: false
|
291
291
|
requirements:
|
@@ -294,7 +294,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
294
294
|
version: '0'
|
295
295
|
segments:
|
296
296
|
- 0
|
297
|
-
hash:
|
297
|
+
hash: 3302315814162737561
|
298
298
|
requirements: []
|
299
299
|
rubyforge_project:
|
300
300
|
rubygems_version: 1.8.25
|