mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Refactor
This commit is contained in:
parent
4c884cce37
commit
9baa65a775
6 changed files with 159 additions and 22 deletions
|
@ -1,11 +1,19 @@
|
|||
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
|
||||
idle_timeout = 0.second
|
||||
EppSession.idle_timeout = idle_timeout
|
||||
timeout = 0.second
|
||||
EppSession.timeout = timeout
|
||||
session = epp_sessions(:api_bestnames)
|
||||
session.update!(updated_at: Time.zone.now - idle_timeout - 1.second)
|
||||
session.update!(updated_at: Time.zone.now - timeout - 1.second)
|
||||
|
||||
run_task
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue