feat: Update the location and country_code when creating or updating the contact (#9106)

* feat: Update the location and country_code when creating or updating the contact.

* chore: improve comments
This commit is contained in:
Muhsin Keloth
2024-03-13 16:40:21 +05:30
committed by GitHub
parent 561fafa198
commit 804a42c271
2 changed files with 16 additions and 0 deletions

View File

@@ -75,4 +75,12 @@ RSpec.describe Contact do
expect(contact.email).to eq 'test@test.com'
end
end
context 'when city and country code passed in additional attributes' do
it 'updates location and country code' do
contact = create(:contact, additional_attributes: { city: 'New York', country: 'US' })
expect(contact.location).to eq 'New York'
expect(contact.country_code).to eq 'US'
end
end
end