mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 10:49:39 +02:00
Expire old pendings #2557
This commit is contained in:
parent
8102b8f1a2
commit
1769ea4227
10 changed files with 77 additions and 14 deletions
|
@ -94,6 +94,30 @@ describe Domain do
|
|||
@domain.registrant_update_confirmable?('123').should == false
|
||||
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 = Fabricate(: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 = Fabricate(:domain)
|
||||
domain.registrant_verification_asked!('frame-str', '1')
|
||||
domain.registrant_verification_asked_at = 30.days.ago
|
||||
domain.pending_delete!
|
||||
|
||||
Domain.clean_expired_pendings.should == 1
|
||||
domain.reload.pending_delete?.should == false
|
||||
domain.pending_json.should == {}
|
||||
end
|
||||
|
||||
it 'should expire domains' do
|
||||
Domain.start_expire_period
|
||||
@domain.statuses.include?(DomainStatus::EXPIRED).should == false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue