mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +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
|
@ -1,7 +1,8 @@
|
|||
require 'rails_helper'
|
||||
|
||||
describe Contact do
|
||||
it { should have_one(:address) }
|
||||
it { should have_one(:local_address) }
|
||||
it { should have_one(:international_address) }
|
||||
|
||||
context 'with invalid attribute' do
|
||||
before(:each) { @contact = Fabricate(:contact) }
|
||||
|
@ -22,7 +23,6 @@ describe Contact do
|
|||
|
||||
expect(@contact.errors.messages).to match_array({
|
||||
code: ['Required parameter missing - code'],
|
||||
name: ['Required parameter missing - name'],
|
||||
phone: ['Required parameter missing - phone', 'Phone nr is invalid'],
|
||||
email: ['Required parameter missing - email', 'Email is invalid'],
|
||||
ident: ['Required parameter missing - ident']
|
||||
|
@ -88,9 +88,8 @@ describe Contact, '.extract_params' do
|
|||
ph = { id: '123123', email: 'jdoe@example.com', postalInfo: { name: 'fred', addr: { cc: 'EE' } } }
|
||||
expect(Contact.extract_attributes(ph)).to eq({
|
||||
code: '123123',
|
||||
email: 'jdoe@example.com',
|
||||
name: 'fred'
|
||||
})
|
||||
email: 'jdoe@example.com'
|
||||
} )
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue