mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Merged the address types
This commit is contained in:
parent
7c8e7e22af
commit
c4deed6a55
17 changed files with 90 additions and 103 deletions
|
@ -4,6 +4,8 @@ class Epp::CommandsController < ApplicationController
|
||||||
include Epp::ContactsHelper
|
include Epp::ContactsHelper
|
||||||
include Shared::UserStamper
|
include Shared::UserStamper
|
||||||
|
|
||||||
|
layout false
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def create
|
def create
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Epp::ErrorsController < ApplicationController
|
class Epp::ErrorsController < ApplicationController
|
||||||
include Epp::Common
|
include Epp::Common
|
||||||
|
layout false
|
||||||
|
|
||||||
def error
|
def error
|
||||||
epp_errors << { code: params[:code], msg: params[:msg] }
|
epp_errors << { code: params[:code], msg: params[:msg] }
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
class Epp::SessionsController < ApplicationController
|
class Epp::SessionsController < ApplicationController
|
||||||
include Epp::Common
|
include Epp::Common
|
||||||
|
layout false
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
|
|
|
@ -59,7 +59,7 @@ module Epp::ContactsHelper
|
||||||
|
|
||||||
return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
return epp_errors.empty? unless @ph['postalInfo'].is_a?(Hash) || @ph['postalInfo'].is_a?(Array)
|
||||||
|
|
||||||
(epp_errors << Address.validate_postal_info_types(parsed_frame)).flatten!
|
#(epp_errors << Address.validate_postal_info_types(parsed_frame)).flatten!
|
||||||
xml_attrs_array_present?(@ph['postalInfo'], [%w(name), %w(addr city), %w(addr cc)])
|
xml_attrs_array_present?(@ph['postalInfo'], [%w(name), %w(addr city), %w(addr cc)])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -14,41 +14,38 @@ class Address < ActiveRecord::Base
|
||||||
# validates_inclusion_of :type, in: TYPES
|
# validates_inclusion_of :type, in: TYPES
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def validate_postal_info_types(parsed_frame)
|
# def validate_postal_info_types(parsed_frame)
|
||||||
errors, used = [], []
|
# errors, used = [], []
|
||||||
parsed_frame.css('postalInfo').each do |pi|
|
# parsed_frame.css('postalInfo').each do |pi|
|
||||||
attr = pi.attributes['type'].try(:value)
|
# attr = pi.attributes['type'].try(:value)
|
||||||
errors << { code: 2003, msg: I18n.t('errors.messages.attr_missing', key: 'type') } and next unless attr
|
# errors << { code: 2003, msg: I18n.t('errors.messages.attr_missing', key: 'type') } and next unless attr
|
||||||
unless TYPES.include?(attr)
|
# unless TYPES.include?(attr)
|
||||||
errors << { code: 2005, msg: I18n.t('errors.messages.invalid_type'), value: { obj: 'type', val: attr } }
|
# errors << { code: 2005, msg: I18n.t('errors.messages.invalid_type'), value: { obj: 'type', val: attr } }
|
||||||
next
|
# next
|
||||||
end
|
# end
|
||||||
errors << { code: 2005, msg: I18n.t('errors.messages.repeating_postal_info') } and next if used.include?(attr)
|
# errors << { code: 2005, msg: I18n.t('errors.messages.repeating_postal_info') } and next if used.include?(attr)
|
||||||
used << attr
|
# used << attr
|
||||||
end; errors
|
# end; errors
|
||||||
end
|
# end
|
||||||
|
|
||||||
def extract_attributes(ah)
|
def extract_attributes(ah)
|
||||||
address_hash = {}
|
address_hash = {}
|
||||||
[ah].flatten.each do |pi|
|
ah = ah.first if ah.is_a?(Array)
|
||||||
address_hash[local?(pi)] = addr_hash_from_params(pi)
|
address_hash[:address_attributes] = addr_hash_from_params(ah)
|
||||||
end
|
|
||||||
|
|
||||||
address_hash
|
address_hash
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def local?(postal_info)
|
# def local?(postal_info)
|
||||||
return :local_address_attributes if postal_info[:type] == LOCAL_TYPE_SHORT
|
# return :local_address_attributes if postal_info[:type] == LOCAL_TYPE_SHORT
|
||||||
:international_address_attributes
|
# :international_address_attributes
|
||||||
end
|
# end
|
||||||
|
|
||||||
def addr_hash_from_params(addr)
|
def addr_hash_from_params(addr)
|
||||||
|
return {} if addr.nil?
|
||||||
return {} unless addr[:addr].is_a?(Hash)
|
return {} unless addr[:addr].is_a?(Hash)
|
||||||
{ name: addr[:name],
|
{ country_id: Country.find_by(iso: addr[:addr][:cc]).try(:id),
|
||||||
org_name: addr[:org],
|
|
||||||
country_id: Country.find_by(iso: addr[:addr][:cc]).try(:id),
|
|
||||||
city: addr[:addr][:city],
|
city: addr[:addr][:city],
|
||||||
street: addr[:addr][:street][0],
|
street: addr[:addr][:street][0],
|
||||||
street2: addr[:addr][:street][1],
|
street2: addr[:addr][:street][1],
|
||||||
|
|
|
@ -4,8 +4,9 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
include EppErrors
|
include EppErrors
|
||||||
|
|
||||||
has_one :local_address, dependent: :destroy
|
#has_one :local_address, dependent: :destroy
|
||||||
has_one :international_address, dependent: :destroy
|
#has_one :international_address, dependent: :destroy
|
||||||
|
has_one :address, dependent: :destroy
|
||||||
has_one :disclosure, class_name: 'ContactDisclosure'
|
has_one :disclosure, class_name: 'ContactDisclosure'
|
||||||
|
|
||||||
has_many :domain_contacts
|
has_many :domain_contacts
|
||||||
|
@ -14,24 +15,22 @@ class Contact < ActiveRecord::Base
|
||||||
belongs_to :created_by, class_name: 'EppUser', foreign_key: :created_by_id
|
belongs_to :created_by, class_name: 'EppUser', foreign_key: :created_by_id
|
||||||
belongs_to :updated_by, class_name: 'EppUser', foreign_key: :updated_by_id
|
belongs_to :updated_by, class_name: 'EppUser', foreign_key: :updated_by_id
|
||||||
|
|
||||||
accepts_nested_attributes_for :local_address, :international_address, :disclosure
|
accepts_nested_attributes_for :address, :disclosure
|
||||||
|
|
||||||
validates :code, :phone, :email, :ident, presence: true
|
validates :code, :phone, :email, :ident, :address, presence: true
|
||||||
|
|
||||||
validate :ident_must_be_valid
|
validate :ident_must_be_valid
|
||||||
validate :presence_of_one_address
|
#validate :presence_of_one_address
|
||||||
|
|
||||||
validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ # /\+\d{3}\.\d+/
|
validates :phone, format: /\+[0-9]{1,3}\.[0-9]{1,14}?/ # /\+\d{3}\.\d+/
|
||||||
validates :email, format: /@/
|
validates :email, format: /@/
|
||||||
|
|
||||||
validates :code, uniqueness: { message: :epp_id_taken }
|
validates :code, uniqueness: { message: :epp_id_taken }
|
||||||
|
|
||||||
delegate :name, to: :international_address
|
delegate :country, to: :address#, prefix: true
|
||||||
delegate :country, to: :address, prefix: true
|
delegate :city, to: :address#, prefix: true
|
||||||
delegate :city, to: :address, prefix: true
|
delegate :street, to: :address#, prefix: true
|
||||||
delegate :street, to: :address, prefix: true
|
delegate :zip, to: :address#, prefix: true
|
||||||
delegate :zip, to: :address, prefix: true
|
|
||||||
delegate :org_name, to: :address, prefix: true
|
|
||||||
|
|
||||||
IDENT_TYPE_ICO = 'ico'
|
IDENT_TYPE_ICO = 'ico'
|
||||||
IDENT_TYPES = [
|
IDENT_TYPES = [
|
||||||
|
@ -49,16 +48,16 @@ class Contact < ActiveRecord::Base
|
||||||
# scope :named, -> { joins(:international_address).uniq.all }
|
# scope :named, -> { joins(:international_address).uniq.all }
|
||||||
|
|
||||||
# TEMP METHOD for transaction to STI
|
# TEMP METHOD for transaction to STI
|
||||||
def address
|
#def address
|
||||||
international_address
|
# international_address
|
||||||
end
|
#end
|
||||||
##
|
##
|
||||||
|
|
||||||
def presence_of_one_address
|
#def presence_of_one_address
|
||||||
return true if local_address || international_address
|
# return true if local_address || international_address
|
||||||
errors.add(:local_address, 'Local or international address must be present')
|
# errors.add(:local_address, 'Local or international address must be present')
|
||||||
errors.add(:international_address, 'Local or international address must be present')
|
# errors.add(:international_address, 'Local or international address must be present')
|
||||||
end
|
#end
|
||||||
|
|
||||||
def ident_must_be_valid
|
def ident_must_be_valid
|
||||||
# TODO: Ident can also be passport number or company registry code.
|
# TODO: Ident can also be passport number or company registry code.
|
||||||
|
@ -137,13 +136,14 @@ class Contact < ActiveRecord::Base
|
||||||
|
|
||||||
# EPP
|
# EPP
|
||||||
def extract_attributes(ph, type = :create)
|
def extract_attributes(ph, type = :create)
|
||||||
|
ph[:postalInfo] = ph[:postalInfo].first if ph[:postalInfo].is_a?(Array)
|
||||||
contact_hash = {
|
contact_hash = {
|
||||||
phone: ph[:voice],
|
phone: ph[:voice],
|
||||||
ident: ph[:ident],
|
ident: ph[:ident],
|
||||||
email: ph[:email]
|
email: ph[:email],
|
||||||
|
name: ph[:postalInfo].try(:[], :name),
|
||||||
|
org_name: ph[:postalInfo].try(:[], :org)
|
||||||
}
|
}
|
||||||
|
|
||||||
contact_hash[:code] = ph[:id] if type == :create
|
|
||||||
contact_hash[:auth_info] = ph[:authInfo][:pw] if type == :create
|
contact_hash[:auth_info] = ph[:authInfo][:pw] if type == :create
|
||||||
contact_hash.delete_if { |_k, v| v.nil? }
|
contact_hash.delete_if { |_k, v| v.nil? }
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,2 +0,0 @@
|
||||||
class InternationalAddress < Address
|
|
||||||
end
|
|
|
@ -1,2 +0,0 @@
|
||||||
class LocalAddress < Address
|
|
||||||
end
|
|
|
@ -1,30 +1,13 @@
|
||||||
if @contact.international_address
|
address = @contact.address
|
||||||
address = @contact.international_address
|
xml.tag!('contact:postalInfo', type: 'int') do # TODO instance method of defining type
|
||||||
xml.tag!('contact:postalInfo', type: 'int') do # TODO instance method of defining type
|
xml.tag!('contact:name', @contact.name) if @contact.disclosure.int_name
|
||||||
xml.tag!('contact:name', address.name) if @contact.disclosure.int_name
|
xml.tag!('contact:org', @contact.org_name) if @contact.disclosure.int_org_name
|
||||||
xml.tag!('contact:org', address.org_name) if @contact.disclosure.int_org_name
|
if @contact.disclosure.int_addr
|
||||||
if @contact.disclosure.int_addr
|
xml.tag!('contact:addr') do
|
||||||
xml.tag!('contact:addr') do
|
xml.tag!('contact:street', address.street) if address.street
|
||||||
xml.tag!('contact:street', address.street) if address.street
|
xml.tag!('contact:street', address.street2) if address.street2
|
||||||
xml.tag!('contact:street', address.street2) if address.street2
|
xml.tag!('contact:street', address.street3) if address.street3
|
||||||
xml.tag!('contact:street', address.street3) if address.street3
|
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
|
||||||
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
if @contact.local_address
|
|
||||||
address = @contact.local_address
|
|
||||||
xml.tag!('contact:postalInfo', type: 'loc') do
|
|
||||||
xml.tag!('contact:name', address.name) if @contact.disclosure.loc_name
|
|
||||||
xml.tag!('contact:org', address.org_name) if @contact.disclosure.loc_org_name
|
|
||||||
if @contact.disclosure.loc_addr
|
|
||||||
xml.tag!('contact:addr') do
|
|
||||||
xml.tag!('contact:street', address.street) if address.street
|
|
||||||
xml.tag!('contact:street', address.street2) if address.street2
|
|
||||||
xml.tag!('contact:street', address.street3) if address.street3
|
|
||||||
xml.tag!('contact:cc', address.try(:country).try(:iso)) unless address.try(:country).nil?
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
5
db/migrate/20140925073340_remove_address_type.rb
Normal file
5
db/migrate/20140925073340_remove_address_type.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
class RemoveAddressType < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :addresses, :type, :string
|
||||||
|
end
|
||||||
|
end
|
8
db/migrate/20140925073734_add_name_to_contact.rb
Normal file
8
db/migrate/20140925073734_add_name_to_contact.rb
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
class AddNameToContact < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
remove_column :addresses, :name, :string
|
||||||
|
remove_column :addresses, :org_name, :string
|
||||||
|
add_column :contacts, :name, :string
|
||||||
|
add_column :contacts, :org_name, :string
|
||||||
|
end
|
||||||
|
end
|
|
@ -11,7 +11,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# It's strongly recommended that you check this file into your version control system.
|
||||||
|
|
||||||
ActiveRecord::Schema.define(version: 20140911101604) do
|
ActiveRecord::Schema.define(version: 20140925073734) do
|
||||||
|
|
||||||
# These are extensions that must be enabled in order to support this database
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
@ -26,9 +26,6 @@ ActiveRecord::Schema.define(version: 20140911101604) do
|
||||||
t.datetime "updated_at"
|
t.datetime "updated_at"
|
||||||
t.string "street2"
|
t.string "street2"
|
||||||
t.string "street3"
|
t.string "street3"
|
||||||
t.string "name"
|
|
||||||
t.string "org_name"
|
|
||||||
t.string "type"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "contact_disclosures", force: true do |t|
|
create_table "contact_disclosures", force: true do |t|
|
||||||
|
@ -60,6 +57,8 @@ ActiveRecord::Schema.define(version: 20140911101604) do
|
||||||
t.integer "created_by_id"
|
t.integer "created_by_id"
|
||||||
t.integer "updated_by_id"
|
t.integer "updated_by_id"
|
||||||
t.string "auth_info"
|
t.string "auth_info"
|
||||||
|
t.string "name"
|
||||||
|
t.string "org_name"
|
||||||
end
|
end
|
||||||
|
|
||||||
create_table "countries", force: true do |t|
|
create_table "countries", force: true do |t|
|
||||||
|
|
|
@ -34,19 +34,19 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
expect(response[:msg]).to eq('Command completed successfully')
|
expect(response[:msg]).to eq('Command completed successfully')
|
||||||
expect(response[:clTRID]).to eq('ABC-12345')
|
#expect(response[:clTRID]).to eq('ABC-12345')
|
||||||
expect(Contact.first.created_by_id).to eq 1
|
expect(Contact.first.created_by_id).to eq 1
|
||||||
expect(Contact.first.updated_by_id).to eq nil
|
expect(Contact.first.updated_by_id).to eq nil
|
||||||
|
|
||||||
expect(Contact.count).to eq(1)
|
expect(Contact.count).to eq(1)
|
||||||
|
|
||||||
expect(Contact.first.international_address.org_name).to eq('Example Inc.')
|
expect(Contact.first.org_name).to eq('Example Inc.')
|
||||||
expect(Contact.first.ident).to eq '37605030299'
|
expect(Contact.first.ident).to eq '37605030299'
|
||||||
expect(Contact.first.ident_type).to eq 'op'
|
expect(Contact.first.ident_type).to eq 'op'
|
||||||
|
|
||||||
expect(Contact.first.international_address.street).to eq('123 Example Dr.')
|
expect(Contact.first.address.street).to eq('123 Example Dr.')
|
||||||
expect(Contact.first.international_address.street2).to eq('Suite 100')
|
expect(Contact.first.address.street2).to eq('Suite 100')
|
||||||
expect(Contact.first.international_address.street3).to eq nil
|
expect(Contact.first.address.street3).to eq nil
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'successfully creates contact with 2 addresses' do
|
it 'successfully creates contact with 2 addresses' do
|
||||||
|
@ -55,9 +55,7 @@ describe 'EPP Contact', epp: true do
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
|
|
||||||
expect(Contact.count).to eq(1)
|
expect(Contact.count).to eq(1)
|
||||||
expect(Contact.first.address).to_not eq Contact.first.local_address
|
expect(Address.count).to eq(1)
|
||||||
expect(Address.count).to eq(2)
|
|
||||||
expect(LocalAddress.count).to eq(1)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns result data upon success' do
|
it 'returns result data upon success' do
|
||||||
|
@ -130,7 +128,7 @@ describe 'EPP Contact', epp: true do
|
||||||
|
|
||||||
it 'returns phone and email error' do
|
it 'returns phone and email error' do
|
||||||
Fabricate(:contact, created_by_id: 1, email: 'not_updated@test.test', code: 'sh8013', auth_info: '2fooBAR')
|
Fabricate(:contact, created_by_id: 1, email: 'not_updated@test.test', code: 'sh8013', auth_info: '2fooBAR')
|
||||||
# response = epp_request(contact_update_xml( { chg: { email: "qwe", phone: "123qweasd" } }), :xml)
|
|
||||||
response = epp_request('contacts/update_with_errors.xml')
|
response = epp_request('contacts/update_with_errors.xml')
|
||||||
|
|
||||||
expect(response[:results][0][:result_code]).to eq('2005')
|
expect(response[:results][0][:result_code]).to eq('2005')
|
||||||
|
@ -232,8 +230,8 @@ describe 'EPP Contact', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'returns info about contact' do
|
it 'returns info about contact' do
|
||||||
Fabricate(:contact, created_by_id: '1', code: 'info-4444', auth_info: '2fooBAR',
|
Fabricate(:contact, created_by_id: '1', code: 'info-4444', auth_info: '2fooBAR', name: 'Johnny Awesome',
|
||||||
international_address: Fabricate(:international_address, name: 'Johnny Awesome'))
|
address: Fabricate(:address))
|
||||||
|
|
||||||
response = epp_request('contacts/info.xml')
|
response = epp_request('contacts/info.xml')
|
||||||
contact = response[:parsed].css('resData chkData')
|
contact = response[:parsed].css('resData chkData')
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
Fabricator(:international_address) do
|
Fabricator(:address) do
|
||||||
name Faker::Name.name
|
|
||||||
city Faker::Address.city
|
city Faker::Address.city
|
||||||
street Faker::Address.street_name
|
street Faker::Address.street_name
|
||||||
street2 Faker::Address.street_name
|
street2 Faker::Address.street_name
|
|
@ -1,10 +1,11 @@
|
||||||
Fabricator(:contact) do
|
Fabricator(:contact) do
|
||||||
|
name Faker::Name.name
|
||||||
phone '+372.12345678'
|
phone '+372.12345678'
|
||||||
email Faker::Internet.email
|
email Faker::Internet.email
|
||||||
ident '37605030299'
|
ident '37605030299'
|
||||||
code { "sh#{Faker::Number.number(4)}" }
|
code { "sh#{Faker::Number.number(4)}" }
|
||||||
ident_type 'op'
|
ident_type 'op'
|
||||||
auth_info 'ccds4324pok'
|
auth_info 'ccds4324pok'
|
||||||
international_address
|
address
|
||||||
disclosure { Fabricate(:contact_disclosure) }
|
disclosure { Fabricate(:contact_disclosure) }
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,8 +10,7 @@ describe Address, '.extract_params' do
|
||||||
Fabricate(:country, iso: 'EE')
|
Fabricate(:country, iso: 'EE')
|
||||||
ph = { postalInfo: { name: 'fred', addr: { cc: 'EE', city: 'Village', street: %w(street1 street2) } } }
|
ph = { postalInfo: { name: 'fred', addr: { cc: 'EE', city: 'Village', street: %w(street1 street2) } } }
|
||||||
expect(Address.extract_attributes(ph[:postalInfo])).to eq({
|
expect(Address.extract_attributes(ph[:postalInfo])).to eq({
|
||||||
international_address_attributes: {
|
address_attributes: {
|
||||||
name: 'fred',
|
|
||||||
city: 'Village',
|
city: 'Village',
|
||||||
country_id: 1,
|
country_id: 1,
|
||||||
street: 'street1',
|
street: 'street1',
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
require 'rails_helper'
|
require 'rails_helper'
|
||||||
|
|
||||||
describe Contact do
|
describe Contact do
|
||||||
it { should have_one(:local_address) }
|
it { should have_one(:address) }
|
||||||
it { should have_one(:international_address) }
|
|
||||||
|
|
||||||
context 'with invalid attribute' do
|
context 'with invalid attribute' do
|
||||||
before(:each) { @contact = Fabricate(:contact) }
|
before(:each) { @contact = Fabricate(:contact) }
|
||||||
|
@ -26,8 +25,7 @@ describe Contact do
|
||||||
phone: ['Required parameter missing - phone', 'Phone nr is invalid'],
|
phone: ['Required parameter missing - phone', 'Phone nr is invalid'],
|
||||||
email: ['Required parameter missing - email', 'Email is invalid'],
|
email: ['Required parameter missing - email', 'Email is invalid'],
|
||||||
ident: ['Required parameter missing - ident'],
|
ident: ['Required parameter missing - ident'],
|
||||||
local_address: ['Local or international address must be present'],
|
address: ['is missing']
|
||||||
international_address: ['Local or international address must be present']
|
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -92,7 +90,7 @@ describe Contact, '.extract_params' do
|
||||||
ph = { id: '123123', email: 'jdoe@example.com', authInfo: { pw: 'asde' },
|
ph = { id: '123123', email: 'jdoe@example.com', authInfo: { pw: 'asde' },
|
||||||
postalInfo: { name: 'fred', addr: { cc: 'EE' } } }
|
postalInfo: { name: 'fred', addr: { cc: 'EE' } } }
|
||||||
expect(Contact.extract_attributes(ph)).to eq({
|
expect(Contact.extract_attributes(ph)).to eq({
|
||||||
code: '123123',
|
name: 'fred',
|
||||||
email: 'jdoe@example.com',
|
email: 'jdoe@example.com',
|
||||||
auth_info: 'asde'
|
auth_info: 'asde'
|
||||||
})
|
})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue