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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user