Merge branch 'master' into registry-790

# Conflicts:
#	app/models/domain_cron.rb
#	lib/tasks/dev.rake
This commit is contained in:
Artur Beljajev 2018-06-18 16:27:56 +03:00
commit 5b821f4074
77 changed files with 278 additions and 496 deletions

View file

@ -2,6 +2,14 @@ require 'rails_helper'
RSpec.describe Authorization::RestrictedIP do
describe '::enabled?', db: true, settings: false do
before do
@original_registrar_ip_whitelist_enabled = Setting.registrar_ip_whitelist_enabled
end
after do
Setting.registrar_ip_whitelist_enabled = @original_registrar_ip_whitelist_enabled
end
context 'when "registrar_ip_whitelist_enabled" is true' do
before do
Setting.registrar_ip_whitelist_enabled = true
@ -13,10 +21,6 @@ RSpec.describe Authorization::RestrictedIP do
end
context 'when "registrar_ip_whitelist_enabled" is false' do
before do
Setting.registrar_ip_whitelist_enabled = false
end
specify do
expect(described_class).to_not be_enabled
end

View file

@ -108,30 +108,6 @@ RSpec.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 = 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
Setting.expire_warning_period = 1
Setting.redemption_grace_period = 1
@ -164,14 +140,6 @@ RSpec.describe Domain do
@domain.statuses.include?(DomainStatus::EXPIRED).should == true
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
before :example do
@save_days_to_renew = Setting.days_to_renew_domain_before_expire