Skip to content

Commit

Permalink
Merge pull request #166 from ignacio-chiazzo/pr-165
Browse files Browse the repository at this point in the history
Added tests for multi clients
  • Loading branch information
ignacio-chiazzo authored Dec 16, 2024
2 parents 2647b80 + d3a491a commit 32615c4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Unreleased

# v 1.0.1
- Send the current client instance to the initializer of the client resource #165
[#165](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/165) @omarowns

# v 1.0.0
- Implement a Better response API [159](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/156)
- Implement a Better API for calling the Cloud API [156](https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/pull/156)
Expand Down
2 changes: 1 addition & 1 deletion lib/whatsapp_sdk/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module WhatsappSdk
VERSION = "1.0.1"
VERSION = "1.0.2"
end
23 changes: 23 additions & 0 deletions test/whatsapp/api/client_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,29 @@ def test_templates
assert_equal(WhatsappSdk::Api::Templates, @client.templates.class)
end

%i[
media
messages
phone_numbers
business_profiles
templates
].each do |api|
define_method("test_#{api}_keeps_same_client") do
api = @client.send(api)

@client.expects(:send_request).with(
http_method: "delete",
full_url: nil,
endpoint: "/1",
params: {},
headers: {},
multipart: false
).returns({ "success" => true })

api.send_request(http_method: "delete", endpoint: "/1")
end
end

private

def stub_test_request(method_name, body: {}, headers: {}, response_status: 200, response_body: { success: true },
Expand Down
2 changes: 1 addition & 1 deletion test/whatsapp/version_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@

class VersionTest < Minitest::Test
def test_that_it_has_a_version_number
assert_equal("1.0.1", WhatsappSdk::VERSION)
assert_equal("1.0.2", WhatsappSdk::VERSION)
end
end

0 comments on commit 32615c4

Please sign in to comment.