Skip to content
Merged
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
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