spec/support/epp.rb
# Example usage:
#
#    login_as :gitlab
#
# Use block for temp login:
#
#    login_as :registrar1 do
#      your test code
#      # will make request as registrar1 and logins back to previous session
#    end
#
Example usage:
login_as :gitlab

Use block for temp login.

login_as :registrar1 do
your test code
will make request as registrar1 and logins back to previous session
end
Example usage : login_as : gitlab Use block for temp login . login_as : registrar1 do your test code will make request as registrar1 and logins back to previous session end
def login_as(user)
    server.open_connection
    if block_given?
      begin
        epp_plain_request(login_xml_for(user), :xml)
        yield
      ensure
        server.open_connection 
        epp_plain_request(login_xml_for(@last_user), :xml)
      end
    else
      @last_user = user 
      epp_plain_request(login_xml_for(user), :xml)
    end
  end
def login_as ( user ) server . open_connection if block_given? begin epp_plain_request ( login_xml_for ( user ) , :xml ) yield ensure server . open_connection epp_plain_request ( login_xml_for ( @last_user ) , :xml ) end else @last_user = user epp_plain_request ( login_xml_for ( user ) , :xml ) end end
Example usage:
login_as :gitlab
Example usage : login_as : gitlab
# return back to last login # save for block
user
<not_specific>