Skip to content

Commit

Permalink
Merge pull request #1171 from internetee/move-tests
Browse files Browse the repository at this point in the history
Move tests
  • Loading branch information
vohmar authored Apr 24, 2019
2 parents 59d6e3e + 7a6ec73 commit 4cb0dce
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -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">
Expand All @@ -24,13 +26,14 @@ def test_bypasses_domain_and_registrant_and_contacts_validation
</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
Expand All @@ -55,6 +58,5 @@ def test_discarded_domain_cannot_be_deleted
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

0 comments on commit 4cb0dce

Please sign in to comment.