mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 16:32:04 +02:00
Merge branch 'master' into refactor-contact-archivation
This commit is contained in:
commit
b2dab0d316
23 changed files with 253 additions and 36 deletions
29
test/tasks/epp/clear_expired_sessions_test.rb
Normal file
29
test/tasks/epp/clear_expired_sessions_test.rb
Normal file
|
@ -0,0 +1,29 @@
|
|||
require 'test_helper'
|
||||
|
||||
class EppClearExpiredSessionsTaskTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@original_session_timeout = EppSession.timeout
|
||||
end
|
||||
|
||||
teardown do
|
||||
EppSession.timeout = @original_session_timeout
|
||||
end
|
||||
|
||||
def test_clears_expired_epp_sessions
|
||||
timeout = EppSession.timeout
|
||||
session = epp_sessions(:api_bestnames)
|
||||
next_session = epp_sessions(:api_goodnames)
|
||||
session.update!(updated_at: Time.zone.now - timeout - 1.second)
|
||||
|
||||
run_task
|
||||
|
||||
assert_nil EppSession.find_by(session_id: session.session_id)
|
||||
assert EppSession.find_by(session_id: next_session.session_id)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def run_task
|
||||
Rake::Task['epp:clear_expired_sessions'].execute
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue