mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Transfer authentication test
This commit is contained in:
parent
2a47e374f2
commit
31ea0f9182
4 changed files with 9 additions and 23 deletions
|
@ -42,7 +42,7 @@ describe 'EPP Domain', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'transfers a domain' do
|
it 'transfers a domain' do
|
||||||
response = epp_request('domains/transfer.xml')
|
response = epp_request(domain_transfer_xml, :xml)
|
||||||
|
|
||||||
d = Domain.first
|
d = Domain.first
|
||||||
dtl = d.domain_transfers.last
|
dtl = d.domain_transfers.last
|
||||||
|
@ -59,7 +59,7 @@ describe 'EPP Domain', epp: true do
|
||||||
s = Setting.find_by(code: 'transfer_wait_time')
|
s = Setting.find_by(code: 'transfer_wait_time')
|
||||||
s.update(value: 1)
|
s.update(value: 1)
|
||||||
|
|
||||||
response = epp_request('domains/transfer.xml')
|
response = epp_request(domain_transfer_xml, :xml)
|
||||||
trn_data = response[:parsed].css('trnData')
|
trn_data = response[:parsed].css('trnData')
|
||||||
d = Domain.first
|
d = Domain.first
|
||||||
|
|
||||||
|
@ -67,25 +67,27 @@ describe 'EPP Domain', epp: true do
|
||||||
expect(trn_data.css('trStatus').text).to eq('pending')
|
expect(trn_data.css('trStatus').text).to eq('pending')
|
||||||
expect(trn_data.css('reID').text).to eq('10577829')
|
expect(trn_data.css('reID').text).to eq('10577829')
|
||||||
expect(trn_data.css('reDate').text).to eq(dtl.transfer_requested_at.to_time.utc.to_s)
|
expect(trn_data.css('reDate').text).to eq(dtl.transfer_requested_at.to_time.utc.to_s)
|
||||||
|
req_time = dtl.transfer_requested_at.to_time.utc.to_s
|
||||||
expect(trn_data.css('acID').text).to eq('10577829')
|
expect(trn_data.css('acID').text).to eq('10577829')
|
||||||
expect(trn_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
expect(trn_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
||||||
|
|
||||||
# should return same data if pending already
|
# should return same data if pending already
|
||||||
response = epp_request('domains/transfer.xml')
|
response = epp_request(domain_transfer_xml, :xml)
|
||||||
trn_data = response[:parsed].css('trnData')
|
trn_data = response[:parsed].css('trnData')
|
||||||
d = Domain.first
|
d = Domain.first
|
||||||
|
|
||||||
expect(trn_data.css('name').text).to eq('example.ee')
|
expect(trn_data.css('name').text).to eq('example.ee')
|
||||||
expect(trn_data.css('trStatus').text).to eq('pending')
|
expect(trn_data.css('trStatus').text).to eq('pending')
|
||||||
expect(trn_data.css('reID').text).to eq('10577829')
|
expect(trn_data.css('reID').text).to eq('10577829')
|
||||||
expect(trn_data.css('reDate').text).to eq(dtl.transfer_requested_at.to_time.utc.to_s)
|
expect(trn_data.css('reDate').text).to eq(req_time)
|
||||||
expect(trn_data.css('acID').text).to eq('10577829')
|
expect(trn_data.css('acID').text).to eq('10577829')
|
||||||
expect(trn_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
expect(trn_data.css('exDate').text).to eq(d.valid_to.to_time.utc.to_s)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'does not transfer with invalid pw' do
|
it 'does not transfer with invalid pw' do
|
||||||
response = epp_request('domains/transfer.xml')
|
response = epp_request(domain_transfer_xml(pw: 'test'), :xml)
|
||||||
|
expect(response[:result_code]).to eq('2200')
|
||||||
|
expect(response[:msg]).to eq('Authentication error')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -297,7 +297,6 @@ describe 'EPP Helper', epp: true do
|
||||||
generated = Nokogiri::XML(domain_transfer_xml).to_s.squish
|
generated = Nokogiri::XML(domain_transfer_xml).to_s.squish
|
||||||
expect(generated).to eq(expected)
|
expect(generated).to eq(expected)
|
||||||
|
|
||||||
|
|
||||||
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||||
<command>
|
<command>
|
||||||
|
|
|
@ -1,15 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
|
||||||
<command>
|
|
||||||
<transfer op="query">
|
|
||||||
<domain:transfer
|
|
||||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
|
||||||
<domain:name>example.ee</domain:name>
|
|
||||||
<domain:authInfo>
|
|
||||||
<domain:pw roid="JD1234-REP">98oiewslkfkd</domain:pw>
|
|
||||||
</domain:authInfo>
|
|
||||||
</domain:transfer>
|
|
||||||
</transfer>
|
|
||||||
<clTRID>ABC-12345</clTRID>
|
|
||||||
</command>
|
|
||||||
</epp>
|
|
|
@ -46,7 +46,7 @@ describe Domain do
|
||||||
name: ['is missing'],
|
name: ['is missing'],
|
||||||
period: ['is not a number'],
|
period: ['is not a number'],
|
||||||
owner_contact: ['Registrant is missing'],
|
owner_contact: ['Registrant is missing'],
|
||||||
admin_contacts: ['Admin contact is missing'],
|
admin_contacts: ['Admin contacts count must be between 1 - infinity'],
|
||||||
nameservers: ['Nameservers count must be between 1-13']
|
nameservers: ['Nameservers count must be between 1-13']
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue