internetee-registry/test/integration/epp/domain/transfer/base_test.rb
Maciej Szlosarczyk 526a9ccd58
Change test structure to follow closer newer Rails 5 rules
* Create new class called ApplicationIntegrationTest, so we don't have
  to override ActionDispatch::IntegrationTest
* Move UI tests to inherit from ApplicationSystemTestCase
* Existing REST API or EPP tests inherit from
  ApplicationIntegrationTest.
* Move `require 'application_system_test_case'` at the end of
  `test_helper`

I don't particularly agree with the Rails' convention of treating UI
tests as system tests and API tests as integration tests, but I see no
benefit in actively fighting against it.
2018-07-27 09:36:27 +03:00

24 lines
856 B
Ruby

require 'test_helper'
class EppDomainTransferBaseTest < ApplicationIntegrationTest
def test_non_existent_domain
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<command>
<transfer op="request">
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>non-existent.test</domain:name>
<domain:authInfo>
<domain:pw>any</domain:pw>
</domain:authInfo>
</domain:transfer>
</transfer>
</command>
</epp>
XML
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_goodnames' }
assert_equal '2303', Nokogiri::XML(response.body).at_css('result')[:code]
end
end