Merge branch 'master' into registry-662

This commit is contained in:
Artur Beljajev 2018-04-18 17:33:00 +03:00
commit 72dcb24e3e
24 changed files with 201 additions and 155 deletions

View file

@ -0,0 +1,16 @@
require 'test_helper'
class AdminAreaDomainDetailsTest < ActionDispatch::IntegrationTest
setup do
login_as users(:admin)
@domain = domains(:shop)
end
def test_discarded_domain_has_corresponding_label
visit admin_domain_url(@domain)
assert_no_css 'span.label.label-warning', text: 'deleteCandidate'
@domain.discard
visit admin_domain_url(@domain)
assert_css 'span.label.label-warning', text: 'deleteCandidate'
end
end

View file

@ -25,4 +25,31 @@ class EppDomainDeleteTest < ActionDispatch::IntegrationTest
assert_equal '1001', Nokogiri::XML(response.body).at_css('result')[:code]
assert_equal 1, Nokogiri::XML(response.body).css('result').size
end
def test_discarded_domain_cannot_be_deleted
domains(:shop).discard
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>
<delete>
<domain:delete xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>shop.test</domain:name>
</domain:delete>
</delete>
<extension>
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
<eis:legalDocument type="pdf">dGVzdCBmYWlsCg==</eis:legalDocument>
</eis:extdata>
</extension>
</command>
</epp>
XML
assert_no_difference 'Domain.count' do
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
end
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
end
end

View file

@ -1,7 +1,7 @@
require 'test_helper'
class EppDomainUpdateTest < ActionDispatch::IntegrationTest
def test_overwrites_existing
def test_update_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">
@ -20,9 +20,29 @@ class EppDomainUpdateTest < ActionDispatch::IntegrationTest
</epp>
XML
post '/epp/command/update', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_equal 'f0ff7d17b0', domains(:shop).transfer_code
assert_equal '1000', Nokogiri::XML(response.body).at_css('result')[:code]
assert_equal 1, Nokogiri::XML(response.body).css('result').size
end
def test_discarded_domain_cannot_be_updated
domains(:shop).discard
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>
<update>
<domain:update xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>shop.test</domain:name>
</domain:update>
</update>
</command>
</epp>
XML
post '/epp/command/update', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
assert_equal '2105', Nokogiri::XML(response.body).at_css('result')[:code]
end
end