mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
Remove unused methods
This commit is contained in:
parent
f774408722
commit
d83e11a85d
3 changed files with 1 additions and 48 deletions
|
@ -199,21 +199,6 @@ class Domain < ActiveRecord::Base
|
||||||
statuses.include? DomainStatus::SERVER_TECH_CHANGE_PROHIBITED
|
statuses.include? DomainStatus::SERVER_TECH_CHANGE_PROHIBITED
|
||||||
end
|
end
|
||||||
|
|
||||||
def self.clean_expired_pendings
|
|
||||||
ActiveSupport::Deprecation.instance.deprecation_warning(DomainCron, __method__)
|
|
||||||
DomainCron.send(__method__)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.start_redemption_grace_period
|
|
||||||
ActiveSupport::Deprecation.instance.deprecation_warning(DomainCron, __method__)
|
|
||||||
DomainCron.send(__method__)
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.destroy_delete_candidates
|
|
||||||
ActiveSupport::Deprecation.instance.deprecation_warning(DomainCron, __method__)
|
|
||||||
DomainCron.send(__method__)
|
|
||||||
end
|
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def nameserver_required?
|
def nameserver_required?
|
||||||
Setting.nameserver_required
|
Setting.nameserver_required
|
||||||
|
|
|
@ -92,7 +92,7 @@ class DomainCron
|
||||||
if domain.save(validate: false)
|
if domain.save(validate: false)
|
||||||
::PaperTrail.whodunnit = "cron - #{__method__}"
|
::PaperTrail.whodunnit = "cron - #{__method__}"
|
||||||
DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
|
DomainDeleteJob.enqueue(domain.id, run_at: rand(((24*60) - (DateTime.now.hour * 60 + DateTime.now.minute))).minutes.from_now)
|
||||||
STDOUT << "#{Time.zone.now.utc} Domain.destroy_delete_candidates: job added by deleteCandidate status ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
|
STDOUT << "#{Time.zone.now.utc} DomainCron.destroy_delete_candidates: job added by deleteCandidate status ##{domain.id} (#{domain.name})\n" unless Rails.env.test?
|
||||||
c += 1
|
c += 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -108,30 +108,6 @@ RSpec.describe Domain do
|
||||||
@domain.registrant_update_confirmable?('123').should == false
|
@domain.registrant_update_confirmable?('123').should == false
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should not find any domain pendings to clean' do
|
|
||||||
Domain.clean_expired_pendings.should == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should not find any domains with wrong pendings' do
|
|
||||||
domain = create(:domain)
|
|
||||||
domain.registrant_verification_asked!('frame-str', '1')
|
|
||||||
domain.registrant_verification_asked_at = 30.days.ago
|
|
||||||
domain.save
|
|
||||||
|
|
||||||
Domain.clean_expired_pendings.should == 0
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should clean domain pendings' do
|
|
||||||
domain = create(:domain)
|
|
||||||
domain.registrant_verification_asked!('frame-str', '1')
|
|
||||||
domain.registrant_verification_asked_at = 30.days.ago
|
|
||||||
domain.pending_delete!
|
|
||||||
|
|
||||||
DomainCron.clean_expired_pendings.should == 1
|
|
||||||
domain.reload.pending_delete?.should == false
|
|
||||||
domain.pending_json.should == {}
|
|
||||||
end
|
|
||||||
|
|
||||||
it 'should expire domains' do
|
it 'should expire domains' do
|
||||||
Setting.expire_warning_period = 1
|
Setting.expire_warning_period = 1
|
||||||
Setting.redemption_grace_period = 1
|
Setting.redemption_grace_period = 1
|
||||||
|
@ -164,14 +140,6 @@ RSpec.describe Domain do
|
||||||
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
|
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'should start redemption grace period' do
|
|
||||||
domain = create(:domain)
|
|
||||||
|
|
||||||
DomainCron.start_redemption_grace_period
|
|
||||||
domain.reload
|
|
||||||
domain.statuses.include?(DomainStatus::SERVER_HOLD).should == false
|
|
||||||
end
|
|
||||||
|
|
||||||
context 'with time period settings' do
|
context 'with time period settings' do
|
||||||
before :example do
|
before :example do
|
||||||
@save_days_to_renew = Setting.days_to_renew_domain_before_expire
|
@save_days_to_renew = Setting.days_to_renew_domain_before_expire
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue