mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
Reformat
This commit is contained in:
parent
26ec7e3f12
commit
087300ff9d
2 changed files with 8 additions and 9 deletions
|
@ -90,8 +90,8 @@ module Epp
|
|||
if params[:parsed_frame].css('newPW').first
|
||||
unless @api_user.update(plain_text_password: params[:parsed_frame].css('newPW').first.text)
|
||||
handle_errors(@api_user) and return
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
epp_session = EppSession.new
|
||||
epp_session.session_id = epp_session_id
|
||||
|
@ -100,8 +100,8 @@ module Epp
|
|||
render_epp_response('login_success')
|
||||
else
|
||||
handle_errors
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def ip_white?
|
||||
webclient_request = ENV['webclient_ips'].split(',').map(&:strip).include?(request.ip)
|
||||
|
@ -125,7 +125,7 @@ module Epp
|
|||
@api_user = current_user # cache current_user for logging
|
||||
epp_session.destroy
|
||||
render_epp_response('logout')
|
||||
end
|
||||
end
|
||||
|
||||
### HELPER METHODS ###
|
||||
|
||||
|
|
|
@ -23,11 +23,11 @@ class EppLoginTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=new_session_id'
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
assert_epp_response :completed_successfully
|
||||
assert EppSession.find_by(session_id: 'new_session_id')
|
||||
assert_equal users(:api_bestnames), EppSession.find_by(session_id: 'new_session_id').user
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
||||
def test_already_logged_in
|
||||
|
@ -56,7 +56,6 @@ class EppLoginTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=any_random_string'
|
||||
|
||||
assert_epp_response :authentication_error_server_closing_connection
|
||||
|
@ -85,8 +84,8 @@ class EppLoginTest < EppTestCase
|
|||
</command>
|
||||
</epp>
|
||||
XML
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=new_session_id'
|
||||
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
assert_equal 'new-password', users(:api_bestnames).plain_text_password
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -123,7 +122,7 @@ class EppLoginTest < EppTestCase
|
|||
end
|
||||
|
||||
assert_difference 'EppSession.count' do
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=new_session_id'
|
||||
end
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
@ -160,7 +159,7 @@ class EppLoginTest < EppTestCase
|
|||
end
|
||||
|
||||
assert_no_difference 'EppSession.count' do
|
||||
post '/epp/session/login', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=new_session_id' }
|
||||
post '/epp/session/login', { frame: request_xml }, 'HTTP_COOKIE' => 'session=new_session_id'
|
||||
end
|
||||
assert_epp_response :authentication_error_server_closing_connection
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue