mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
Return epp error 2306 is tech are admin contacts are duplicated
This commit is contained in:
parent
560d9111ce
commit
3dfb22d79d
2 changed files with 34 additions and 27 deletions
|
@ -162,6 +162,9 @@ class Epp::Domain < Domain
|
||||||
at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action)
|
at[:admin_domain_contacts_attributes] = admin_domain_contacts_attrs(frame, action)
|
||||||
at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action)
|
at[:tech_domain_contacts_attributes] = tech_domain_contacts_attrs(frame, action)
|
||||||
|
|
||||||
|
check_for_same_contacts(at[:admin_domain_contacts_attributes], 'admin')
|
||||||
|
check_for_same_contacts(at[:tech_domain_contacts_attributes], 'tech')
|
||||||
|
|
||||||
pw = frame.css('authInfo > pw').text
|
pw = frame.css('authInfo > pw').text
|
||||||
at[:transfer_code] = pw if pw.present?
|
at[:transfer_code] = pw if pw.present?
|
||||||
|
|
||||||
|
@ -176,6 +179,11 @@ class Epp::Domain < Domain
|
||||||
at
|
at
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def check_for_same_contacts(contacts, contact_type)
|
||||||
|
return unless contacts.uniq.count != contacts.count
|
||||||
|
|
||||||
|
add_epp_error('2306', contact_type, nil, %i[domain_contacts invalid])
|
||||||
|
end
|
||||||
|
|
||||||
# Adding legal doc to domain and
|
# Adding legal doc to domain and
|
||||||
# if something goes wrong - raise Rollback error
|
# if something goes wrong - raise Rollback error
|
||||||
|
|
|
@ -120,34 +120,33 @@ class EppDomainCreateBaseTest < EppTestCase
|
||||||
registrant = contact.becomes(Registrant)
|
registrant = contact.becomes(Registrant)
|
||||||
|
|
||||||
request_xml = <<-XML
|
request_xml = <<-XML
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
<command>
|
<command>
|
||||||
<create>
|
<create>
|
||||||
<domain:create xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
<domain:create xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||||
<domain:name>#{name}</domain:name>
|
<domain:name>#{name}</domain:name>
|
||||||
<domain:registrant>#{registrant.code}</domain:registrant>
|
<domain:registrant>#{registrant.code}</domain:registrant>
|
||||||
<domain:contact type="admin">#{contact.code}</domain:contact>
|
<domain:contact type="admin">#{contact.code}</domain:contact>
|
||||||
<domain:contact type="admin">#{contact.code}</domain:contact>
|
<domain:contact type="admin">#{contact.code}</domain:contact>
|
||||||
<domain:contact type="tech">#{contact.code}</domain:contact>
|
<domain:contact type="tech">#{contact.code}</domain:contact>
|
||||||
<domain:contact type="tech">#{contact.code}</domain:contact>
|
<domain:contact type="tech">#{contact.code}</domain:contact>
|
||||||
</domain:create>
|
</domain:create>
|
||||||
</create>
|
</create>
|
||||||
<extension>
|
<extension>
|
||||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||||
<eis:legalDocument type="pdf">#{'test' * 2000}</eis:legalDocument>
|
<eis:legalDocument type="pdf">#{'test' * 2000}</eis:legalDocument>
|
||||||
</eis:extdata>
|
</eis:extdata>
|
||||||
</extension>
|
</extension>
|
||||||
</command>
|
</command>
|
||||||
</epp>
|
</epp>
|
||||||
XML
|
XML
|
||||||
|
|
||||||
|
assert_no_difference 'Domain.count' do
|
||||||
|
post epp_create_path, params: { frame: request_xml },
|
||||||
assert_no_difference 'Domain.count' do
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
post epp_create_path, params: { frame: request_xml },
|
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_epp_response :parameter_value_policy_error
|
assert_epp_response :parameter_value_policy_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -180,7 +179,7 @@ class EppDomainCreateBaseTest < EppTestCase
|
||||||
</epp>
|
</epp>
|
||||||
XML
|
XML
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
assert_no_difference 'Domain.count' do
|
assert_no_difference 'Domain.count' do
|
||||||
post epp_create_path, params: { frame: request_xml },
|
post epp_create_path, params: { frame: request_xml },
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue