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:
Andres Keskküla 2014-08-26 10:09:52 +03:00
commit 8d5152d400
17 changed files with 343 additions and 195 deletions

View file

@ -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