chore: Review fix
This commit is contained in:
@@ -214,6 +214,22 @@ RSpec.describe DataImportJob do
|
||||
expect(bob.additional_attributes['country']).to be_nil
|
||||
expect(bob.additional_attributes['country_code']).to be_nil
|
||||
end
|
||||
|
||||
it 'populates the country_code column for new contacts via the bulk import path' do
|
||||
described_class.perform_now(country_data_import)
|
||||
|
||||
expect(Contact.from_email('john-country@example.com').country_code).to eq('United States')
|
||||
expect(Contact.from_email('jane-country@example.com').country_code).to eq('India')
|
||||
expect(Contact.from_email('bob-country@example.com').country_code).to eq('')
|
||||
end
|
||||
|
||||
it 'populates the country_code column when updating an existing contact' do
|
||||
existing = create(:contact, account: country_data_import.account, email: 'john-country@example.com')
|
||||
|
||||
described_class.perform_now(country_data_import)
|
||||
|
||||
expect(existing.reload.country_code).to eq('United States')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the data contains labels column' do
|
||||
|
||||
Reference in New Issue
Block a user