Renamed ident flag to type

This commit is contained in:
Andres Keskküla 2015-01-08 11:50:44 +02:00
parent 8c20f2697b
commit 3f5b37db5c
3 changed files with 3 additions and 3 deletions

View file

@ -168,7 +168,7 @@ module Epp::ContactsHelper
end end
def ident_type def ident_type
result = parsed_frame.css('ident').first.try(:attributes).try(:[], 'flag').try(:value) result = parsed_frame.css('ident').first.try(:attributes).try(:[], 'type').try(:value)
return nil unless result return nil unless result
Contact::IDENT_TYPES.any? { |type| return type if result.include?(type) } Contact::IDENT_TYPES.any? { |type| return type if result.include?(type) }

View file

@ -58,7 +58,7 @@ describe 'EPP Contact', epp: true do
end end
it 'successfully saves ident type' do it 'successfully saves ident type' do
xml = {ident: { value: '37605030299' , attrs: { flag: 'birthday' } }} xml = {ident: { value: '37605030299' , attrs: { type: 'birthday' } }}
response = epp_request(create_contact_xml(xml), :xml) response = epp_request(create_contact_xml(xml), :xml)
expect(Contact.last.ident_type).to eq('birthday') expect(Contact.last.ident_type).to eq('birthday')
end end

View file

@ -11,7 +11,7 @@ module EppContactXmlHelper
}, },
voice: { value: '+372.1234567' }, voice: { value: '+372.1234567' },
email: { value: 'test@example.example' }, email: { value: 'test@example.example' },
ident: { value: '37605030299' , attrs: { flag: 'op' } } ident: { value: '37605030299' , attrs: { type: 'op' } }
} }
xml_params = defaults.deep_merge(xml_params) xml_params = defaults.deep_merge(xml_params)