diff --git a/test/integration/epp/domain/update/replace_dns_test.rb b/test/integration/epp/domain/update/replace_dns_test.rb index 51f307dc73..62dcbc299f 100644 --- a/test/integration/epp/domain/update/replace_dns_test.rb +++ b/test/integration/epp/domain/update/replace_dns_test.rb @@ -1,101 +1,8 @@ require 'test_helper' class EppDomainUpdateReplaceDnsTest < EppTestCase - include ActionMailer::TestHelper - include ActiveJob::TestHelper - - setup do - @domain = domains(:shop) - @contact = contacts(:john) - @dnskey = dnskeys(:one) - @dnskey.update(domain: @domain) - @original_registrant_change_verification = - Setting.request_confirmation_on_registrant_change_enabled - ActionMailer::Base.deliveries.clear - end - - teardown do - Setting.request_confirmation_on_registrant_change_enabled = - @original_registrant_change_verification - end - - def test_remove_dnskey_if_explicitly_set - request_xml = <<-XML - - - - - - shop.test - - - f0ff7d17b0 - - - - - - - - - #{@dnskey.flags} - #{@dnskey.protocol} - #{@dnskey.alg} - #{@dnskey.public_key} - - - - - - - XML - - post epp_update_path, params: { frame: request_xml }, - headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } - response_xml = Nokogiri::XML(response.body) - assert_correct_against_schema response_xml - @domain.reload - assert_equal 0, @domain.dnskeys.count - assert_epp_response :completed_successfully - end - - def test_remove_dnskey_if_remove_all - request_xml = <<-XML - - - - - - shop.test - - - f0ff7d17b0 - - - - - - - - true - - - - - - XML - - post epp_update_path, params: { frame: request_xml }, - headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } - response_xml = Nokogiri::XML(response.body) - assert_correct_against_schema response_xml - @domain.reload - assert_equal 0, @domain.dnskeys.count - assert_epp_response :completed_successfully - end - - def test_replace_dnskey_with_spaces_in_request - doc = Nokogiri::XML::Document.parse(schema_new) + def test_parsed_response_for_dnskey_with_spaces_in_request + doc = Nokogiri::XML::Document.parse(schema_update) params = { parsed_frame: doc } domain_controller = Epp::DomainsController.new domain_controller.params = ActionController::Parameters.new(params) @@ -104,7 +11,7 @@ def test_replace_dnskey_with_spaces_in_request assert_equal(domain_controller.send(:parsed_response_for_dnskey, 'add'), true) end - def schema_new + def schema_update <<~XML