Remove contact's address on domain transfer unless address_processing is enabled

#251
This commit is contained in:
Artur Beljajev 2016-12-14 05:49:13 +02:00
parent a63e2b9dd2
commit 68c3f0c338
3 changed files with 21 additions and 0 deletions

View file

@ -448,4 +448,19 @@ RSpec.describe Contact, db: false do
expect(contact.errors).to have_key(:country_code)
end
end
describe '#remove_address' do
let(:contact) { described_class.new(city: 'test',
street: 'test',
zip: 'test',
country_code: 'test',
state: 'test')
}
subject(:address_removed) { contact.attributes.slice(*described_class.address_attribute_names).compact.empty? }
it 'removes address attributes' do
contact.remove_address
expect(address_removed).to be_truthy
end
end
end