From 50ec60e80c533ddaf3951497408d518bb55c7454 Mon Sep 17 00:00:00 2001 From: ignacio-chiazzo Date: Sun, 15 Dec 2024 22:56:24 -0300 Subject: [PATCH 1/2] Added tests for multi clients --- test/whatsapp/api/client_test.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/test/whatsapp/api/client_test.rb b/test/whatsapp/api/client_test.rb index 39ed27a..9844a78 100644 --- a/test/whatsapp/api/client_test.rb +++ b/test/whatsapp/api/client_test.rb @@ -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 }, From d3a491a2bdc80f6df9a81513be03ff632eee3e12 Mon Sep 17 00:00:00 2001 From: ignacio-chiazzo Date: Sun, 15 Dec 2024 23:05:08 -0300 Subject: [PATCH 2/2] Cut release 1.0.2 --- CHANGELOG.md | 4 ++++ lib/whatsapp_sdk/version.rb | 2 +- test/whatsapp/version_test.rb | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c88af07..4cf451b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/lib/whatsapp_sdk/version.rb b/lib/whatsapp_sdk/version.rb index b44a0ce..bfc4974 100644 --- a/lib/whatsapp_sdk/version.rb +++ b/lib/whatsapp_sdk/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module WhatsappSdk - VERSION = "1.0.1" + VERSION = "1.0.2" end diff --git a/test/whatsapp/version_test.rb b/test/whatsapp/version_test.rb index ef90a59..010cc8c 100644 --- a/test/whatsapp/version_test.rb +++ b/test/whatsapp/version_test.rb @@ -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