mirror of
https://github.com/internetee/registry.git
synced 2025-07-02 17:23:34 +02:00
Epp User login
This commit is contained in:
parent
76ec918426
commit
e20b138644
12 changed files with 106 additions and 8 deletions
|
@ -15,13 +15,43 @@ describe 'EPP Session', type: :epp do
|
|||
before(:each) { server.open_connection }
|
||||
after(:each) { server.close_connection }
|
||||
|
||||
it 'logs in epp user' do
|
||||
it 'does not log in with invalid user' do
|
||||
response = Nokogiri::XML(server.send_request(read_body('login.xml')))
|
||||
result = response.css('epp response result').first
|
||||
expect(result[:code]).to eq('2501')
|
||||
|
||||
msg = response.css('epp response result msg').text
|
||||
expect(msg).to eq('Authentication error; server closing connection')
|
||||
|
||||
Fabricate(:epp_user, active: false)
|
||||
|
||||
response = Nokogiri::XML(server.send_request(read_body('login.xml')))
|
||||
result = response.css('epp response result').first
|
||||
expect(result[:code]).to eq('2501')
|
||||
end
|
||||
|
||||
it 'logs in epp user' do
|
||||
Fabricate(:epp_user)
|
||||
|
||||
response = Nokogiri::XML(server.send_request(read_body('login.xml')))
|
||||
|
||||
result = response.css('epp response result').first
|
||||
expect(result[:code]).to eq('1000')
|
||||
|
||||
msg = response.css('epp response result msg').text
|
||||
expect(msg).to eq('User test was authenticated. Welcome.')
|
||||
expect(msg).to eq('Command completed successfully')
|
||||
end
|
||||
|
||||
it 'does not log in twice' do
|
||||
Fabricate(:epp_user)
|
||||
server.send_request(read_body('login.xml'))
|
||||
response = Nokogiri::XML(server.send_request(read_body('login.xml')))
|
||||
|
||||
result = response.css('epp response result').first
|
||||
expect(result[:code]).to eq('2002')
|
||||
|
||||
msg = response.css('epp response result msg').text
|
||||
expect(msg).to match(/Already logged in. Use/)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue