mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Merge branch 'registry-707' into registry-694
This commit is contained in:
commit
fafb224c00
8 changed files with 53 additions and 4 deletions
|
@ -556,8 +556,6 @@ class Epp::Domain < Domain
|
|||
end
|
||||
|
||||
def epp_destroy(frame, user_id)
|
||||
return false unless valid?
|
||||
|
||||
check_discarded
|
||||
|
||||
if doc = attach_legal_document(Epp::Domain.parse_legal_document_from_frame(frame))
|
||||
|
|
1
test/fixtures/contacts.yml
vendored
1
test/fixtures/contacts.yml
vendored
|
@ -34,5 +34,6 @@ acme_ltd:
|
|||
invalid:
|
||||
name: any
|
||||
code: any
|
||||
email: invalid@invalid.test
|
||||
auth_info: any
|
||||
registrar: bestnames
|
||||
|
|
10
test/fixtures/domain_contacts.yml
vendored
10
test/fixtures/domain_contacts.yml
vendored
|
@ -12,3 +12,13 @@ library_john:
|
|||
domain: library
|
||||
contact: john
|
||||
type: AdminDomainContact
|
||||
|
||||
invalid_invalid_admin:
|
||||
domain: invalid
|
||||
contact: invalid
|
||||
type: AdminDomainContact
|
||||
|
||||
invalid_invalid_tech:
|
||||
domain: invalid
|
||||
contact: invalid
|
||||
type: TechDomainContact
|
||||
|
|
7
test/fixtures/domains.yml
vendored
7
test/fixtures/domains.yml
vendored
|
@ -27,3 +27,10 @@ library:
|
|||
valid_to: 2010-07-05
|
||||
period: 1
|
||||
period_unit: m
|
||||
|
||||
invalid:
|
||||
name: invalid.test
|
||||
transfer_code: any
|
||||
valid_to: 2010-07-05
|
||||
registrar: bestnames
|
||||
registrant: invalid
|
||||
|
|
28
test/integration/epp/domain/domain_delete_test.rb
Normal file
28
test/integration/epp/domain/domain_delete_test.rb
Normal file
|
@ -0,0 +1,28 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainDeleteTest < ActionDispatch::IntegrationTest
|
||||
def test_bypasses_domain_and_registrant_and_contacts_validation
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
<command>
|
||||
<delete>
|
||||
<domain:delete xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>invalid.test</domain:name>
|
||||
</domain:delete>
|
||||
</delete>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">dGVzdCBmYWlsCg==</eis:legalDocument>
|
||||
</eis:extdata>
|
||||
</extension>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
assert_includes Domain.find_by(name: 'invalid.test').statuses, DomainStatus::PENDING_DELETE_CONFIRMATION
|
||||
assert_equal '1001', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
assert_equal 1, Nokogiri::XML(response.body).css('result').size
|
||||
end
|
||||
end
|
|
@ -9,6 +9,7 @@ class RegistrarDomainsTest < ActionDispatch::IntegrationTest
|
|||
Domain,Transfer code,Registrant name,Registrant code,Date of expiry
|
||||
library.test,45118f5,Acme Ltd,acme-ltd-001,2010-07-05
|
||||
shop.test,65078d5,John,john-001,2010-07-05
|
||||
invalid.test,any,any,any,2010-07-05
|
||||
airport.test,55438j5,John,john-001,2010-07-05
|
||||
CSV
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ class ContactTest < ActiveSupport::TestCase
|
|||
@contact = contacts(:john)
|
||||
end
|
||||
|
||||
def test_validates
|
||||
def test_valid_fixture_is_valid
|
||||
assert @contact.valid?
|
||||
end
|
||||
|
||||
|
|
|
@ -5,7 +5,11 @@ class DomainTest < ActiveSupport::TestCase
|
|||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_validates
|
||||
def test_valid_fixture_is_valid
|
||||
assert @domain.valid?
|
||||
end
|
||||
|
||||
def test_invalid_fixture_is_invalid
|
||||
assert domains(:invalid).invalid?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue