fix: update admin contact validation error code

- Change error code from 2004 to 2306 for admin contact validation
- Add explicit validation check for required admin contacts
- Update tests to expect new error code

The error code 2306 better reflects the EPP standard for policy-based
validation failures. This change makes the error handling more consistent
with EPP specifications when validating admin contact requirements.
This commit is contained in:
oleghasjanov 2025-02-05 10:54:21 +02:00
parent dc37223bc2
commit a56237c84f
2 changed files with 10 additions and 4 deletions

View file

@ -142,7 +142,7 @@ class ReppV1DomainsContactsTest < ActionDispatch::IntegrationTest
@domain.reload
assert_response :bad_request
assert_equal 2004, json[:code]
assert_equal 2306, json[:code]
assert @domain.admin_contacts.any?
end
@ -159,7 +159,7 @@ class ReppV1DomainsContactsTest < ActionDispatch::IntegrationTest
json = JSON.parse(response.body, symbolize_names: true)
assert_response :bad_request
assert_equal 2004, json[:code]
assert_equal 2306, json[:code]
assert @domain.admin_contacts.any?
end
@ -178,7 +178,7 @@ class ReppV1DomainsContactsTest < ActionDispatch::IntegrationTest
json = JSON.parse(response.body, symbolize_names: true)
assert_response :bad_request
assert_equal 2004, json[:code]
assert_equal 2306, json[:code]
assert @domain.admin_contacts.any?
end
@ -217,7 +217,7 @@ class ReppV1DomainsContactsTest < ActionDispatch::IntegrationTest
json = JSON.parse(response.body, symbolize_names: true)
assert_response :bad_request
assert_equal 2004, json[:code]
assert_equal 2306, json[:code]
assert @domain.admin_contacts.any?
end