mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
Logout command
This commit is contained in:
parent
b812ea384e
commit
44b257efa3
11 changed files with 90 additions and 1 deletions
21
spec/epp/requests/create_domain.xml
Normal file
21
spec/epp/requests/create_domain.xml
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd">
|
||||
<command>
|
||||
<create>
|
||||
<domain:create xmlns:domain="http://www.nic.cz/xml/epp/domain-1.4" xsi:schemaLocation="http://www.nic.cz/xml/epp/domain-1.4 domain-1.4.xsd">
|
||||
<domain:name>testing.ee</domain:name>
|
||||
<domain:period unit="y">1</domain:period>
|
||||
<domain:nsset>name_server_set1</domain:nsset>
|
||||
<domain:registrant>domain_registrator1</domain:registrant>
|
||||
<domain:admin>administrative_contact1</domain:admin>
|
||||
<domain:authInfo>password</domain:authInfo>
|
||||
</domain:create>
|
||||
</create>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="urn:ee:eis:xml:epp:eis-1.0" xsi:schemaLocation="urn:ee:eis:xml:epp:eis-1.0 eis-1.0.xsd">
|
||||
<eis:legalDocument type="ddoc">.... base64 encoded document ....</eis:legalDocument>
|
||||
</eis:extdata>
|
||||
</extension>
|
||||
<clTRID>dpbx005#10-01-29at19:21:47</clTRID>
|
||||
</command>
|
||||
</epp>
|
7
spec/epp/requests/logout.xml
Normal file
7
spec/epp/requests/logout.xml
Normal file
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
<command>
|
||||
<logout/>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
|
@ -30,6 +30,14 @@ describe 'EPP Session', epp: true do
|
|||
expect(result[:code]).to eq('2501')
|
||||
end
|
||||
|
||||
it 'prohibits further actions unless logged in' do
|
||||
response = Nokogiri::XML(server.send_request(read_body('create_domain.xml')))
|
||||
expect(parse_result_code(response)).to eq('2002')
|
||||
|
||||
msg = response.css('epp response result msg').text
|
||||
expect(msg).to eq('You need to login first.')
|
||||
end
|
||||
|
||||
it 'logs in epp user' do
|
||||
Fabricate(:epp_user)
|
||||
|
||||
|
@ -42,6 +50,17 @@ describe 'EPP Session', epp: true do
|
|||
expect(msg).to eq('Command completed successfully')
|
||||
end
|
||||
|
||||
it 'logs out epp user' do
|
||||
Fabricate(:epp_user)
|
||||
server.send_request(read_body('login.xml'))
|
||||
response = Nokogiri::XML(server.send_request(read_body('logout.xml')))
|
||||
result = response.css('epp response result').first
|
||||
expect(result[:code]).to eq('1500')
|
||||
|
||||
msg = response.css('epp response result msg').text
|
||||
expect(msg).to eq('Command completed successfully; ending session')
|
||||
end
|
||||
|
||||
it 'does not log in twice' do
|
||||
Fabricate(:epp_user)
|
||||
server.send_request(read_body('login.xml'))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue