mirror of
https://github.com/internetee/registry.git
synced 2025-06-12 15:44:45 +02:00
Handle past domains.delete_at
This commit is contained in:
parent
e4305e7865
commit
07bc0546bb
2 changed files with 4 additions and 3 deletions
|
@ -15,10 +15,11 @@ module Concerns::Domain::Deletable
|
|||
end
|
||||
|
||||
def deletion_time_span
|
||||
Time.zone.now.to_i..deletion_deadline.to_i
|
||||
range_params = [Time.zone.now.to_i, deletion_deadline.to_i].sort
|
||||
Range.new(*range_params)
|
||||
end
|
||||
|
||||
def deletion_deadline
|
||||
delete_at + 24.hours
|
||||
end
|
||||
end
|
||||
end
|
|
@ -20,7 +20,7 @@ class DomainDiscardableTest < ActiveSupport::TestCase
|
|||
def test_discarding_a_domain_schedules_deletion_at_random_time
|
||||
@domain.discard
|
||||
other_domain = domains(:airport)
|
||||
other_domain.delete_at = Time.zone.parse('2010-07-05 10:00')
|
||||
other_domain.delete_at = Time.zone.parse('2010-07-04')
|
||||
other_domain.discard
|
||||
|
||||
background_job = QueJob.find_by("args->>0 = '#{@domain.id}'", job_class: DomainDeleteJob.name)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue