mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 17:01:44 +02:00
Merge branch 'postalinfo'
Conflicts: app/helpers/epp/contacts_helper.rb app/models/address.rb app/models/contact.rb db/schema.rb spec/epp/contact_spec.rb spec/fabricators/contact_fabricator.rb spec/fabricators/international_address_fabricator.rb spec/models/address_spec.rb spec/models/contact_spec.rb
This commit is contained in:
commit
8d5152d400
17 changed files with 343 additions and 195 deletions
|
@ -7,13 +7,16 @@ end
|
|||
|
||||
describe Address, '.extract_params' do
|
||||
it 'returns params hash'do
|
||||
Fabricate(:country, iso: 'EE')
|
||||
ph = { postalInfo: { name: 'fred', addr: { cc: 'EE', city: 'Village', street: %w(street1 street2) } } }
|
||||
expect(Address.extract_attributes(ph[:postalInfo][:addr])).to eq({
|
||||
city: 'Village',
|
||||
country_id: 1,
|
||||
street: 'street1',
|
||||
street2: 'street2'
|
||||
Fabricate(:country, iso:'EE')
|
||||
ph = { postalInfo: { name: "fred", addr: { cc: 'EE', city: 'Village', street: [ 'street1', 'street2' ] } } }
|
||||
expect(Address.extract_attributes(ph[:postalInfo])).to eq( {
|
||||
international_address_attributes: {
|
||||
name: 'fred',
|
||||
city: 'Village',
|
||||
country_id: 1,
|
||||
street: 'street1',
|
||||
street2: 'street2',
|
||||
}
|
||||
})
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue