This commit is contained in:
Martin Lensment 2015-05-20 21:40:28 +03:00
parent 6725b3cadc
commit e2809cc285
3 changed files with 5 additions and 3 deletions

View file

@ -47,6 +47,7 @@ class Epp::SessionsController < EppController
end
def connection_limit_ok?
return true if Rails.env.test?
c = EppSession.where(
'registrar_id = ? AND updated_at >= ?', @api_user.registrar_id, Time.zone.now - 5.minutes
).count

View file

@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20150520163237) do
ActiveRecord::Schema.define(version: 20150520164507) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"

View file

@ -76,14 +76,15 @@ describe 'EPP Session', epp: true do
end
it 'logs out epp user' do
c = EppSession.count
epp_plain_request(@login_xml_cache, :xml)
EppSession.last[:api_user_id].should == 1
EppSession.count.should == c + 1
response = epp_plain_request(@epp_xml.session.logout, :xml)
response[:msg].should == 'Command completed successfully; ending session'
response[:result_code].should == '1500'
EppSession.last[:api_user_id].should == nil
EppSession.count.should == c
end
it 'changes password and logs in' do