mirror of
https://github.com/internetee/registry.git
synced 2025-06-08 05:34:46 +02:00
commit
4cb0dcead7
1 changed files with 6 additions and 4 deletions
|
@ -1,11 +1,13 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppDomainDeleteTest < ApplicationIntegrationTest
|
||||
class EppDomainDeleteBaseTest < ActionDispatch::IntegrationTest
|
||||
def setup
|
||||
@domain = domains(:shop)
|
||||
end
|
||||
|
||||
def test_bypasses_domain_and_registrant_and_contacts_validation
|
||||
assert_equal 'invalid.test', domains(:invalid).name
|
||||
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
|
@ -24,13 +26,14 @@ class EppDomainDeleteTest < ApplicationIntegrationTest
|
|||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/delete', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
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
|
||||
|
||||
def test_discarded_domain_cannot_be_deleted
|
||||
assert_equal 'shop.test', @domain.name
|
||||
@domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE])
|
||||
|
||||
request_xml = <<-XML
|
||||
|
@ -55,6 +58,5 @@ class EppDomainDeleteTest < ApplicationIntegrationTest
|
|||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
end
|
||||
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||
travel_back
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue