Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Artur Beljajev committed Jan 2, 2019
1 parent d07db9a commit 239d74f
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
1 change: 0 additions & 1 deletion test/fixtures/billing/prices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ create_one_year:
price_cents: 1000
operation_category: create
valid_from: 2010-07-05
valid_to: 2010-07-05
zone: test

renew_one_year:
Expand Down
36 changes: 36 additions & 0 deletions test/integration/epp/domain/create/base_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
require 'test_helper'

class EppDomainCreateBaseTest < ApplicationIntegrationTest
def test_domain_can_be_registered_with_required_attributes_only
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>
<create>
<domain:create xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>new.test</domain:name>
<domain:registrant>john-001</domain:registrant>
</domain:create>
</create>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:legalDocument type="pdf">#{'test' * 2000}</eis:legalDocument>
</eis:extdata>
</extension>
</command>
</epp>
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

0 comments on commit 239d74f

Please sign in to comment.