mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Fix contact create in registrar #2752
This commit is contained in:
parent
4c52e3b0b4
commit
e463fe4d70
3 changed files with 29 additions and 28 deletions
|
@ -145,25 +145,26 @@ module Depp
|
||||||
end
|
end
|
||||||
|
|
||||||
def save
|
def save
|
||||||
create_xml = Depp::Contact.epp_xml.create(
|
hash = {
|
||||||
{
|
|
||||||
id: { value: code },
|
id: { value: code },
|
||||||
email: { value: email },
|
|
||||||
voice: { value: phone },
|
|
||||||
postalInfo: {
|
postalInfo: {
|
||||||
name: { value: name },
|
name: { value: name },
|
||||||
org: { value: org_name },
|
org: { value: org_name },
|
||||||
addr: {
|
addr: {
|
||||||
street: { value: street },
|
street: { value: street },
|
||||||
city: { value: city },
|
city: { value: city },
|
||||||
pc: { value: zip },
|
|
||||||
sp: { value: state },
|
sp: { value: state },
|
||||||
|
pc: { value: zip },
|
||||||
cc: { value: country_code }
|
cc: { value: country_code }
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
},
|
||||||
extension_xml
|
voice: { value: phone },
|
||||||
)
|
email: { value: email }
|
||||||
|
}
|
||||||
|
|
||||||
|
hash[:id] = nil if code.blank?
|
||||||
|
create_xml = Depp::Contact.epp_xml.create(hash, extension_xml)
|
||||||
|
|
||||||
data = Depp::Contact.user.request(create_xml)
|
data = Depp::Contact.user.request(create_xml)
|
||||||
self.id = data.css('id').text
|
self.id = data.css('id').text
|
||||||
handle_errors(data)
|
handle_errors(data)
|
||||||
|
|
|
@ -87,8 +87,8 @@ describe 'EPP Poll', epp: true do
|
||||||
})
|
})
|
||||||
|
|
||||||
response = epp_plain_request(xml, validate_input: false)
|
response = epp_plain_request(xml, validate_input: false)
|
||||||
response[:msg].should == 'Parameter value range error: op'
|
response[:msg].should == "Element '{urn:ietf:params:xml:ns:epp-1.0}poll', attribute 'op': [facet 'enumeration'] The value 'bla' is not an element of the set {'ack', 'req'}."
|
||||||
response[:result_code].should == '2004'
|
response[:result_code].should == '2001'
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'dequeues multiple messages' do
|
it 'dequeues multiple messages' do
|
||||||
|
|
|
@ -142,8 +142,8 @@ describe 'EPP Session', epp: true do
|
||||||
newPW: { value: '' }
|
newPW: { value: '' }
|
||||||
), validate_input: false)
|
), validate_input: false)
|
||||||
|
|
||||||
response[:msg].should == 'Password is missing [password]'
|
response[:msg].should == "Element '{urn:ietf:params:xml:ns:epp-1.0}newPW': [facet 'minLength'] The value has a length of '0'; this underruns the allowed minimum length of '6'."
|
||||||
response[:result_code].should == '2306'
|
response[:result_code].should == '2001'
|
||||||
|
|
||||||
@api_user.reload
|
@api_user.reload
|
||||||
@api_user.password.should == 'ghyt9e4fu'
|
@api_user.password.should == 'ghyt9e4fu'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue