require 'test_helper' class EppDomainCreateBaseTest < ApplicationIntegrationTest def test_domain_can_be_registered_with_required_attributes_only request_xml = <<-XML new.test john-001 #{'test' * 2000} XML assert_difference 'Domain.count' do post '/epp/command/create', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' end domain = Domain.last assert_equal 'new.test', domain.name assert_equal contacts(:john).becomes(Registrant), domain.registrant response_xml = Nokogiri::XML(response.body) assert_equal '1000', response_xml.at_css('result')[:code] assert_equal 1, Nokogiri::XML(response.body).css('result').size end end