mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
1cc780f3ce
commit
049219efed
2 changed files with 0 additions and 24 deletions
|
@ -602,19 +602,6 @@ class Domain < ActiveRecord::Base
|
|||
self.statuses |= [DomainStatus::EXPIRED]
|
||||
end
|
||||
|
||||
def set_expired
|
||||
# TODO: currently valid_to attribute update logic is open
|
||||
# self.valid_to = valid_from + self.class.convert_period_to_time(period, period_unit)
|
||||
self.outzone_at = (valid_to + Setting.expire_warning_period.days).utc.beginning_of_day
|
||||
self.delete_at = (outzone_at + Setting.redemption_grace_period.days).utc.beginning_of_day
|
||||
statuses << DomainStatus::EXPIRED
|
||||
end
|
||||
|
||||
def set_expired!
|
||||
set_expired
|
||||
save(validate: false)
|
||||
end
|
||||
|
||||
def pending_update?
|
||||
statuses.include?(DomainStatus::PENDING_UPDATE) && !statuses.include?(DomainStatus::FORCE_DELETE)
|
||||
end
|
||||
|
|
|
@ -350,17 +350,6 @@ RSpec.describe Domain do
|
|||
@domain.statuses.include?(DomainStatus::SERVER_HOLD).should == true
|
||||
end
|
||||
|
||||
|
||||
it 'should set expired status and update outzone_at and delete_at' do
|
||||
domain = Fabricate(:domain)
|
||||
domain.statuses.should == ['ok']
|
||||
domain.set_expired
|
||||
domain.changes.keys.should == ['statuses', 'outzone_at', 'delete_at']
|
||||
domain.save
|
||||
|
||||
domain.statuses.should == ['expired']
|
||||
end
|
||||
|
||||
it 'should know its create price' do
|
||||
Fabricate(:pricelist, {
|
||||
category: 'ee',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue