mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
More test fixes #2623
This commit is contained in:
parent
6229d6cb35
commit
6ad458e20f
3 changed files with 18 additions and 19 deletions
|
@ -244,12 +244,6 @@ class Domain < ActiveRecord::Base
|
|||
domain_transfers.find_by(status: DomainTransfer::PENDING)
|
||||
end
|
||||
|
||||
def can_be_deleted?
|
||||
(domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::SERVER_DELETE_PROHIBITED}
|
||||
)).empty?
|
||||
end
|
||||
|
||||
def expirable?
|
||||
return false if valid_to > Time.zone.now
|
||||
!statuses.include?(DomainStatus::EXPIRED)
|
||||
|
@ -338,9 +332,7 @@ class Domain < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def pending_delete?
|
||||
(domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::PENDING_DELETE}
|
||||
)).present?
|
||||
statuses.include?(DomainStatus::PENDING_DELETE)
|
||||
end
|
||||
|
||||
def pending_delete!
|
||||
|
@ -348,7 +340,9 @@ class Domain < ActiveRecord::Base
|
|||
self.epp_pending_delete = true # for epp
|
||||
|
||||
return true unless registrant_verification_asked?
|
||||
domain_statuses.create(value: DomainStatus::PENDING_DELETE)
|
||||
statuses << DomainStatus::PENDING_DELETE
|
||||
save(validate: false) # should check if this did succeed
|
||||
|
||||
DomainMailer.pending_deleted(self).deliver_now
|
||||
end
|
||||
|
||||
|
|
|
@ -659,9 +659,7 @@ class Epp::Domain < Domain
|
|||
begin
|
||||
errors.add(:base, :domain_status_prohibits_operation)
|
||||
return false
|
||||
end if (domain_statuses.pluck(:value) & %W(
|
||||
#{DomainStatus::CLIENT_DELETE_PROHIBITED}
|
||||
)).any?
|
||||
end if statuses.include?(DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||
|
||||
true
|
||||
end
|
||||
|
|
|
@ -1839,10 +1839,11 @@ describe 'EPP Domain', epp: true do
|
|||
response[:results][0][:msg].should == 'Command completed successfully'
|
||||
response[:results][0][:result_code].should == '1000'
|
||||
|
||||
d.reload
|
||||
d.dnskeys.count.should == 1
|
||||
|
||||
d.domain_statuses.count.should == 1
|
||||
d.domain_statuses.first.value.should == 'clientUpdateProhibited'
|
||||
d.statuses.count.should == 1
|
||||
d.statuses.first.should == 'clientUpdateProhibited'
|
||||
|
||||
rem_ns = d.nameservers.find_by(hostname: 'ns1.example.com')
|
||||
rem_ns.should be_falsey
|
||||
|
@ -1861,8 +1862,12 @@ describe 'EPP Domain', epp: true do
|
|||
response[:results][1][:value].should == 'FIXED:CITIZEN_1234'
|
||||
|
||||
response[:results][2][:result_code].should == '2303'
|
||||
response[:results][2][:msg].should == 'Status was not found'
|
||||
response[:results][2][:value].should == 'clientHold'
|
||||
response[:results][2][:msg].should == 'DS was not found'
|
||||
response[:results][2][:value].should == '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f'
|
||||
|
||||
response[:results][3][:result_code].should == '2303'
|
||||
response[:results][3][:msg].should == 'Status was not found'
|
||||
response[:results][3][:value].should == 'clientHold'
|
||||
end
|
||||
|
||||
it 'does not remove server statuses' do
|
||||
|
@ -2318,7 +2323,8 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'does not delete domain with specific status' do
|
||||
domain.domain_statuses.create(value: DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||
domain.statuses << DomainStatus::CLIENT_DELETE_PROHIBITED
|
||||
domain.save
|
||||
|
||||
response = epp_plain_request(@epp_xml.domain.delete({
|
||||
name: { value: domain.name }
|
||||
|
@ -2336,7 +2342,8 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'does not delete domain with pending delete' do
|
||||
domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE)
|
||||
domain.statuses << DomainStatus::PENDING_DELETE
|
||||
domain.save
|
||||
|
||||
response = epp_plain_request(@epp_xml.domain.delete({
|
||||
name: { value: domain.name }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue