fix: phone number handling in leadsquared (#11527)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
This commit is contained in:
Shivam Mishra
2025-05-22 13:34:27 +05:30
committed by GitHub
parent 4b417ce9e7
commit 99de5f4257
3 changed files with 38 additions and 2 deletions

View File

@@ -16,6 +16,7 @@ RSpec.describe Crm::Leadsquared::Mappers::ContactMapper do
name: 'John',
last_name: 'Doe',
email: 'john@example.com',
# the phone number is intentionally wrong
phone_number: '+1234567890'
)
@@ -29,6 +30,19 @@ RSpec.describe Crm::Leadsquared::Mappers::ContactMapper do
'Source' => 'Test Brand'
)
end
it 'represents the phone number correctly' do
contact.update!(
name: 'John',
last_name: 'Doe',
email: 'john@example.com',
phone_number: '+917507684392'
)
mapped_data = described_class.map(contact)
expect(mapped_data).to include('Mobile' => '+91-7507684392')
end
end
end
end