Skip to content

Commit

Permalink
Merge pull request #499 from intercom/jonny/fix-privatised-method-name
Browse files Browse the repository at this point in the history
Fix private method error and add test
  • Loading branch information
jonnyom authored Nov 5, 2019
2 parents 8966ce6 + 8fec48f commit b3281ae
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 1 addition & 2 deletions lib/intercom/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,7 @@ def execute(target_base_url=nil, username:, secret: nil, read_timeout: 90, open_
:rate_limit_details

private :path,
:net_http_method,
:rate_limit_details
:net_http_method

private def client(uri, read_timeout:, open_timeout:)
net = Net::HTTP.new(uri.host, uri.port)
Expand Down
10 changes: 10 additions & 0 deletions spec/unit/intercom/client_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,16 @@ module Intercom
it 'raises on empty api version' do
proc { Client.new(app_id: app_id, api_key: api_key, api_version: '') }.must_raise MisconfiguredClientError
end

it "assigns works" do
stub_request(:any, "https://api.intercom.io/users?id=123").to_return(
status: [200, "OK"],
headers: { 'X-RateLimit-Reset' => Time.now.utc + 10 },
body: { "test": "testing" }.to_json
)

client.get("/users", { id: "123" })
end
end

describe 'OAuth clients' do
Expand Down

0 comments on commit b3281ae

Please sign in to comment.