Allow creating domain with custom auth info

This commit is contained in:
Martin Lensment 2015-08-13 12:11:24 +03:00
parent eff8dd5d7a
commit 3c934d70e8
2 changed files with 18 additions and 0 deletions

View file

@ -152,6 +152,9 @@ class Epp::Domain < Domain
at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action)
# at[:domain_statuses_attributes] = domain_statuses_attrs(frame, action)
pw = frame.css('authInfo > pw').text
at[:auth_info] = pw if pw.present?
if new_record?
dnskey_frame = frame.css('extension create')
else
@ -419,6 +422,7 @@ class Epp::Domain < Domain
registrant_verification_asked!(frame.to_s, current_user.id)
end
self.deliver_emails = true # turn on email delivery for epp
errors.empty? && super(at)
end
# rubocop: enable Metrics/AbcSize

View file

@ -147,6 +147,20 @@ describe 'EPP Domain', epp: true do
d.reserved.should == false
end
it 'creates a domain with custom auth info' do
dn = next_domain_name
response = epp_plain_request(domain_create_xml({
name: { value: dn },
authInfo: { pw: { value: 'asdasd' } }
}))
d = Domain.last
response[:msg].should == 'Command completed successfully'
response[:result_code].should == '1000'
d.auth_info.should == 'asdasd'
end
# it 'creates ria.ee with valid ds record' do
# xml = domain_create_xml({
# name: { value: 'ria.ee' }