mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 10:16:01 +02:00
Extend outzone_at and delete_at also on domain renew #2622
This commit is contained in:
parent
1e23641e01
commit
9bd832278c
3 changed files with 18 additions and 0 deletions
|
@ -410,6 +410,14 @@ class Domain < ActiveRecord::Base
|
|||
def manage_automatic_statuses
|
||||
# domain_statuses.create(value: DomainStatus::DELETE_CANDIDATE) if delete_candidateable?
|
||||
|
||||
# if domain_statuses.exists?(value: DomainStatus::FORCE_DELETE)
|
||||
# domain_statuses.where(value: DomainStatus::SERVER_RENEW_PROHIBITED).first_or_create
|
||||
# domain_statuses.where(value: DomainStatus::SERVER_TRANSFER_PROHIBITED).first_or_create
|
||||
# domain_statuses.where(value: DomainStatus::SERVER_UPDATE_PROHIBITED).first_or_create
|
||||
# domain_statuses.where(value: DomainStatus::SERVER_MANUAL_INZONE).first_or_create
|
||||
# domain_statuses.where(value: DomainStatus::PENDING_DELETE).first_or_create
|
||||
# end
|
||||
|
||||
if domain_statuses.empty? && valid?
|
||||
domain_statuses.create(value: DomainStatus::OK)
|
||||
elsif domain_statuses.length > 1 || !valid?
|
||||
|
|
|
@ -434,6 +434,8 @@ class Epp::Domain < Domain
|
|||
|
||||
p = self.class.convert_period_to_time(period, unit)
|
||||
self.valid_to = valid_to + p
|
||||
self.outzone_at = outzone_at + p
|
||||
self.delete_at = delete_at + p
|
||||
self.period = period
|
||||
self.period_unit = unit
|
||||
|
||||
|
|
|
@ -2070,7 +2070,10 @@ describe 'EPP Domain', epp: true do
|
|||
|
||||
it 'should renew a expired domain' do
|
||||
domain.valid_to = Time.zone.now - 50.days
|
||||
new_valid_to = domain.valid_to + 1.year
|
||||
domain.outzone_at = Time.zone.now - 50.days
|
||||
new_outzone_at = domain.outzone_at + 1.year
|
||||
new_delete_at = domain.delete_at + 1.year
|
||||
domain.save
|
||||
|
||||
Domain.start_expire_period
|
||||
|
@ -2095,6 +2098,11 @@ describe 'EPP Domain', epp: true do
|
|||
domain.domain_statuses.where(value: DomainStatus::EXPIRED).count.should == 0
|
||||
domain.domain_statuses.where(value: DomainStatus::SERVER_HOLD).count.should == 0
|
||||
domain.domain_statuses.where(value: DomainStatus::OK).count.should == 1
|
||||
|
||||
domain.reload
|
||||
domain.valid_to.should be_within(5).of(new_valid_to)
|
||||
domain.outzone_at.should be_within(5).of(new_outzone_at)
|
||||
domain.delete_at.should be_within(5).of(new_delete_at)
|
||||
end
|
||||
|
||||
it 'does not renew foreign domain' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue