mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
updated tests
This commit is contained in:
parent
ab26100e78
commit
a896e78e51
9 changed files with 75 additions and 28 deletions
|
@ -6,6 +6,11 @@ module Domains
|
|||
DomainStatus::SERVER_RENEW_PROHIBITED,
|
||||
DomainStatus::SERVER_TRANSFER_PROHIBITED,
|
||||
DomainStatus::CLIENT_HOLD]
|
||||
domain.force_delete_domain_statuses_history += [ DomainStatus::SERVER_TRANSFER_PROHIBITED,
|
||||
DomainStatus::SERVER_OBJ_UPDATE_PROHIBITED,
|
||||
DomainStatus::SERVER_DELETE_PROHIBITED
|
||||
] if domain.locked_by_registrant?
|
||||
domain.admin_store_statuses_history -= domain_statuses unless domain.admin_store_statuses_history.nil?
|
||||
rejected_statuses = domain.statuses.reject { |a| domain_statuses.include? a }
|
||||
domain.statuses = rejected_statuses
|
||||
domain.save(validate: false)
|
||||
|
|
|
@ -2,9 +2,13 @@ module Domains
|
|||
module CancelForceDelete
|
||||
class RestoreStatusesBeforeForceDelete < Base
|
||||
def execute
|
||||
domain.statuses = domain.force_delete_domain_statuses_history || []
|
||||
domain.statuses += domain.force_delete_domain_statuses_history || []
|
||||
domain.statuses += domain.admin_store_statuses_history || []
|
||||
domain.statuses.uniq!
|
||||
|
||||
domain.statuses_before_force_delete = nil
|
||||
domain.force_delete_domain_statuses_history = nil
|
||||
domain.admin_store_statuses_history = nil
|
||||
domain.save(validate: false)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -23,6 +23,7 @@ module Domain::RegistryLockable
|
|||
end
|
||||
|
||||
def apply_statuses_locked_statuses(extensions_prohibited:)
|
||||
self.admin_store_statuses_history = self.statuses
|
||||
self.statuses |= LOCK_STATUSES
|
||||
self.statuses |= EXTENSIONS_STATUS if Feature.obj_and_extensions_statuses_enabled? && extensions_prohibited
|
||||
self.locked_by_registrant_at = Time.zone.now
|
||||
|
@ -53,6 +54,8 @@ module Domain::RegistryLockable
|
|||
end
|
||||
|
||||
def remove_statuses_from_locked_domain
|
||||
# binding.pry
|
||||
# self.admin_store_statuses_history = self.statuses
|
||||
LOCK_STATUSES.each do |domain_status|
|
||||
statuses.delete([domain_status])
|
||||
end
|
||||
|
|
|
@ -23,7 +23,7 @@ class RegistrantUser < User
|
|||
company_register.representation_rights(citizen_personal_code: ident,
|
||||
citizen_country_code: country.alpha3)
|
||||
end
|
||||
|
||||
|
||||
def contacts(representable: true)
|
||||
Contact.registrant_user_contacts(self, representable: representable)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue