mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
parent
ab77a1ae31
commit
e1e41a962e
2 changed files with 1 additions and 13 deletions
|
@ -32,12 +32,11 @@ class DomainCron
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.start_expire_period
|
def self.start_expire_period
|
||||||
Rails.logger.info('Expiring domains')
|
|
||||||
|
|
||||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||||
domains = Domain.expired
|
domains = Domain.expired
|
||||||
marked = 0
|
marked = 0
|
||||||
real = 0
|
real = 0
|
||||||
|
|
||||||
domains.each do |domain|
|
domains.each do |domain|
|
||||||
next unless domain.expirable?
|
next unless domain.expirable?
|
||||||
real += 1
|
real += 1
|
||||||
|
|
|
@ -38,15 +38,4 @@ RSpec.describe DomainCron do
|
||||||
@domain.reload
|
@domain.reload
|
||||||
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
|
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '::start_expire_period', db: false do
|
|
||||||
before :example do
|
|
||||||
travel_to Time.zone.parse('05.07.2010')
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'logs start time' do
|
|
||||||
expect(Rails.logger).to receive(:info).with('Expiring domains')
|
|
||||||
described_class.start_expire_period
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue