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

Build Fix #235

Merged
merged 1 commit into from
Aug 8, 2018
Merged
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
13 changes: 7 additions & 6 deletions spec/cases/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
context "Company API", :vcr do

it "should be able to view a company profile" do
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586").to_return(:body => "{}")
stub_request(:get, "https://api.linkedin.com/v1/companies/1586").to_return(:body => "{}")
client.company(:id => 1586).should be_an_instance_of(LinkedIn::Mash)
end

Expand All @@ -150,8 +150,9 @@
end

it "should load correct company data" do
stub_request(:get, "https://api.linkedin.com/v1/companies/1586:(id,name,industry,locations:(address:(city,state,country-code),is-headquarters),employee-count-range)").to_return(:body => "{\"id\":1586,\"name\":\"Amazon\",\"employee_count_range\":{\"name\":\"10001+\"},\"industry\":\"Internet\",\"locations\":{\"all\":[{\"address\":{\"city\":\"Seattle\"},\"is_headquarters\":true}]}}")
stub_request(:get, "https://api.linkedin.com/v1/companies/1586").to_return(:body => "{\"id\":1586,\"name\":\"Amazon\"}")
client.company(:id => 1586).name.should == "Amazon"

data = client.company(:id => 1586, :fields => %w{ id name industry locations:(address:(city state country-code) is-headquarters) employee-count-range })
data.id.should == 1586
data.name.should == "Amazon"
Expand All @@ -162,22 +163,22 @@
end

it "should be able to view company_updates" do
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates").to_return(:body => "{}")
stub_request(:get, "https://api.linkedin.com/v1/companies/1586/updates").to_return(:body => "{}")
client.company_updates(:id => 1586).should be_an_instance_of(LinkedIn::Mash)
end

it "should be able to view company_statistic" do
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/company-statistics").to_return(:body => "{}")
stub_request(:get, "https://api.linkedin.com/v1/companies/1586/company-statistics").to_return(:body => "{}")
client.company_statistics(:id => 1586).should be_an_instance_of(LinkedIn::Mash)
end

it "should be able to view company updates comments" do
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/update-comments").to_return(:body => "{}")
stub_request(:get, "https://api.linkedin.com/v1/companies/1586/updates/key=company_update_key/update-comments").to_return(:body => "{}")
client.company_updates_comments("company_update_key", :id => 1586).should be_an_instance_of(LinkedIn::Mash)
end

it "should be able to view company updates likes" do
stub_request(:get, "https://api.linkedin.com/v1/companies/id=1586/updates/key=company_update_key/likes").to_return(:body => "{}")
stub_request(:get, "https://api.linkedin.com/v1/companies/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

Expand Down