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
|
||||||
|
|
|
@ -142,12 +142,11 @@ 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 },
|
||||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_epp_response :parameter_value_policy_error
|
assert_epp_response :parameter_value_policy_error
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue