require 'test_helper'
class EppDomainUpdateTest < EppTestCase
def setup
@domain = domains(:shop)
end
def test_update_domain
request_xml = <<-XML
shop.test
f0ff7d17b0
XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
@domain.reload
assert_equal 'f0ff7d17b0', @domain.transfer_code
assert_epp_response :completed_successfully
end
def test_discarded_domain_cannot_be_updated
@domain.update!(statuses: [DomainStatus::DELETE_CANDIDATE])
request_xml = <<-XML
shop.test
XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_epp_response :object_is_not_eligible_for_renewal
end
end