-
Notifications
You must be signed in to change notification settings - Fork 40
Update http gem to 5.0.4 #2998
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
Update http gem to 5.0.4 #2998
Changes from all commits
23eb17a
032f6f1
c31ce1d
5dc5fdd
23aafe0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,7 +78,7 @@ def execute_post(url, data) | |
| def parse_response(response) | ||
| return unless response.status.ok? | ||
|
|
||
| JSON.parse(response, symbolize_names: true) | ||
| response.parse(:json).deep_symbolize_keys | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The http gem has a |
||
| end | ||
|
|
||
| def base_uri | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,16 @@ | |
| "Authorization" => "Basic #{auth_token}", | ||
| "Connection" => "close", | ||
| "Host" => "api.exotel.com", | ||
| "User-Agent" => "http.rb/4.4.1" | ||
| "User-Agent" => "http.rb/#{HTTP::VERSION}" | ||
| } | ||
| end | ||
|
|
||
| around do |example| | ||
| WebMock.disallow_net_connect! | ||
| example.run | ||
| WebMock.allow_net_connect! | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This made tracking down spec failures easier, because our suite defaults to this being allowed for feature specs to work. |
||
| end | ||
|
|
||
| describe "#call_details" do | ||
| let!(:call_details_200) { File.read("spec/support/fixtures/call_details_200.json") } | ||
| let!(:call_details_400) { File.read("spec/support/fixtures/call_details_400.json") } | ||
|
|
@@ -27,18 +33,19 @@ | |
| "Authorization" => "Basic #{auth_token}", | ||
| "Connection" => "close", | ||
| "Host" => "api.exotel.com", | ||
| "User-Agent" => "http.rb/4.4.1" | ||
| "User-Agent" => "http.rb/#{HTTP::VERSION}" | ||
| } | ||
| end | ||
|
|
||
| it "should return call details for a session id in json when status is 200" do | ||
| stub_request(:get, request_url).with(headers: request_headers).to_return(status: 200, | ||
| body: call_details_200, | ||
| headers: {}) | ||
| response = described_class.new(sid, token).call_details(call_sid) | ||
|
|
||
| expected_call_details_response = described_class.new(sid, token).call_details(call_sid) | ||
|
|
||
| expect(expected_call_details_response[:Call].keys).to eq(%i[Sid | ||
| expect(response[:Call][:From]).to eq("09663127355") | ||
| expect(response[:Call][:To]).to eq("01930483621") | ||
| expect(response[:Call].keys).to eq(%i[Sid | ||
| ParentCallSid | ||
| DateCreated | ||
| DateUpdated | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more http-parser!