Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two new API's added for companies #194

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions lib/linked_in/api/query_methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ def company_updates_likes(update_key, options={})
path = "#{company_path(options)}/updates/key=#{update_key}/likes"
simple_query(path, options)
end

def suggested_companies
simple_query('/people/~/suggestions/to-follow/companies')
end

def followed_companies
simple_query('/people/~/following/companies')
end

def job(options = {})
path = jobs_path(options)
Expand Down
11 changes: 10 additions & 1 deletion spec/cases/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/likes").to_return(:body => "{}")
client.company_updates_likes("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash)
end

it "should be able to follow a company" do
stub_request(:post, "https://api.linkedin.com/v1/people/~/following/companies").to_return(:body => "", :status => 201)

Expand All @@ -191,7 +191,16 @@
response.body.should == nil
response.code.should == "201"
end

it "should be able to retrive list of companies user currently following" do
stub_request(:get, "https://api.linkedin.com/v1/people/~/following/companies").to_return(:body => "{}")
client.followed_companies.should be_an_instance_of(LinkedIn::Mash)
end

it "should be able to retrive list of suggested companies to follow" do
stub_request(:get, "https://api.linkedin.com/v1/people/~/suggestions/to-follow/companies").to_return(:body => "{}")
client.suggested_companies.should be_an_instance_of(LinkedIn::Mash)
end
end

context "Job API" do
Expand Down