mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Rubocop autocorrect
This commit is contained in:
parent
f8c48a7456
commit
6c5c0b38c8
59 changed files with 533 additions and 546 deletions
|
@ -1,22 +1,19 @@
|
|||
require "rails_helper"
|
||||
require 'rails_helper'
|
||||
|
||||
describe Address do
|
||||
it { should belong_to(:contact) }
|
||||
it { should belong_to(:country) }
|
||||
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: [ 'street1', 'street2' ] } } }
|
||||
expect(Address.extract_attributes(ph[:postalInfo][:addr])).to eq( {
|
||||
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'
|
||||
} )
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue