Skip to content

Commit

Permalink
Merge pull request #170 from ignacio-chiazzo/ruby-2.7
Browse files Browse the repository at this point in the history
Added Support Ruby 2.7
  • Loading branch information
ignacio-chiazzo authored Jan 15, 2025
2 parents 5203763 + 552b343 commit d351f8b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
1 change: 0 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ AllCops:
- 'example.rb'
- 'tmp/*'
- 'vendor/**/*'
TargetRubyVersion: 3.1

Style/HashSyntax:
Enabled: false
Expand Down
2 changes: 1 addition & 1 deletion lib/whatsapp_sdk/api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def templates
def send_request(endpoint: "", full_url: nil, http_method: "post", params: {}, headers: {}, multipart: false)
url = full_url || "#{ApiConfiguration::API_URL}/#{@api_version}/"

faraday_request = faraday(url:, multipart:)
faraday_request = faraday(url: url, multipart: multipart)

response = faraday_request.public_send(http_method, endpoint, request_params(params, headers), headers)

Expand Down
6 changes: 3 additions & 3 deletions test/whatsapp/api/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,9 @@ def test_templates
def stub_test_request(method_name, body: {}, headers: {}, response_status: 200, response_body: { success: true },
api_version: ApiConfiguration::DEFAULT_API_VERSION)
stub_request(method_name, "#{ApiConfiguration::API_URL}/#{api_version}/test")
.with(body:, headers: { 'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Authorization' => 'Bearer test_token' }.merge(headers))
.with(body: body, headers: { 'Accept' => '*/*',
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
'Authorization' => 'Bearer test_token' }.merge(headers))
.to_return(status: response_status, body: response_body.to_json, headers: {})
end

Expand Down

0 comments on commit d351f8b

Please sign in to comment.