Merge pull request #1171 from internetee/move-tests

Move tests
This commit is contained in:
Timo Võhmar 2019-04-24 16:26:41 +03:00 committed by GitHub
commit 4cb0dcead7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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