diff --git a/spec/enterprise/services/enterprise/whatsapp/providers/whatsapp_cloud_service_spec.rb b/spec/enterprise/services/enterprise/whatsapp/providers/whatsapp_cloud_service_spec.rb index 4cbfd27e8..87dc6d70c 100644 --- a/spec/enterprise/services/enterprise/whatsapp/providers/whatsapp_cloud_service_spec.rb +++ b/spec/enterprise/services/enterprise/whatsapp/providers/whatsapp_cloud_service_spec.rb @@ -4,8 +4,10 @@ describe Whatsapp::Providers::WhatsappCloudService do subject(:service) { described_class.new(whatsapp_channel: whatsapp_channel) } let(:whatsapp_channel) { create(:channel_whatsapp, provider: 'whatsapp_cloud', validate_provider_config: false, sync_templates: false) } - let(:calls_url) { 'https://graph.facebook.com/v13.0/123456789/calls' } - let(:messages_url) { 'https://graph.facebook.com/v13.0/123456789/messages' } + # Call-flow endpoints use the configured WHATSAPP_API_VERSION (fallback v22.0), + # not the OSS v13.0 path locked for legacy /messages compatibility. + let(:calls_url) { 'https://graph.facebook.com/v22.0/123456789/calls' } + let(:messages_url) { 'https://graph.facebook.com/v22.0/123456789/messages' } let(:headers) { { 'Content-Type' => 'application/json' } } before { stub_request(:get, /message_templates/) } diff --git a/spec/enterprise/services/whatsapp/call_permission_reply_service_spec.rb b/spec/enterprise/services/whatsapp/call_permission_reply_service_spec.rb index 4504c7d9e..82a91395c 100644 --- a/spec/enterprise/services/whatsapp/call_permission_reply_service_spec.rb +++ b/spec/enterprise/services/whatsapp/call_permission_reply_service_spec.rb @@ -19,7 +19,8 @@ describe Whatsapp::CallPermissionReplyService do end before do - channel.provider_config = channel.provider_config.merge('calling_enabled' => true) + account.enable_features!('channel_voice') + channel.provider_config = channel.provider_config.merge('source' => 'embedded_signup', 'calling_enabled' => true) channel.save! end