Replaced address with local and international addr

This commit is contained in:
Andres Keskküla 2014-08-25 17:05:57 +03:00
parent fe54f327d9
commit 2655da4555
16 changed files with 208 additions and 57 deletions

View file

@ -10,11 +10,14 @@ describe Address, '.extract_params' do
it 'returns params hash'do
Fabricate(:country, iso:'EE')
ph = { postalInfo: { name: "fred", addr: { cc: 'EE', city: 'Village', street: [ 'street1', 'street2' ] } } }
expect(Address.extract_attributes(ph[:postalInfo][:addr])).to eq( {
city: 'Village',
country_id: 1,
street: 'street1',
street2: '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