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

DEVX-6439: Update Messages API Template Message class #242

Merged
merged 2 commits into from
Aug 25, 2022
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
1 change: 0 additions & 1 deletion lib/vonage/messaging/channels/whats_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def verify_message
raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
raise Vonage::ClientError.new(":name is required in :template") unless message[:name]
raise Vonage::ClientError.new(":whatsapp is required in :opts") unless opts[:whatsapp]
raise Vonage::ClientError.new(":policy is required in :whatsapp") unless opts[:whatsapp][:policy]
raise Vonage::ClientError.new(":locale is required in :whatsapp") unless opts[:whatsapp][:locale]
when 'custom'
raise Vonage::ClientError.new(":message must be a Hash") unless message.is_a? Hash
Expand Down
9 changes: 0 additions & 9 deletions test/vonage/messaging/channels/whats_app_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,15 +95,6 @@ def test_template_message_without_whatsapp_object
assert_match ":whatsapp is required in :opts", exception.message
end

def test_template_message_without_whatsapp_object_policy
exception = assert_raises {
whatsapp = Vonage::Messaging::Channels::WhatsApp.new(type: 'template', message: { name: 'verify'}, opts: { whatsapp: { locale: 'en-GB'} })
}

assert_instance_of Vonage::ClientError, exception
assert_match ":policy is required in :whatsapp", exception.message
end

def test_template_message_without_whatsapp_object_locale
exception = assert_raises {
whatsapp = Vonage::Messaging::Channels::WhatsApp.new(type: 'template', message: { name: 'verify'}, opts: { whatsapp: { policy: 'deterministic'} })
Expand Down