mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
implement domain statuses restore after domain locked, added test
This commit is contained in:
parent
90cb154d15
commit
28a54d6612
6 changed files with 645 additions and 885 deletions
|
@ -33,6 +33,16 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
assert_not(@domain.locked_by_registrant?)
|
||||
end
|
||||
|
||||
def test_restore_domain_statuses_after_unlock
|
||||
@domain.update(statuses: [DomainStatus::SERVER_UPDATE_PROHIBITED])
|
||||
@domain.apply_registry_lock
|
||||
assert @domain.locked_by_registrant?
|
||||
assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort
|
||||
|
||||
@domain.remove_registry_lock
|
||||
assert @domain.statuses.include? DomainStatus::SERVER_UPDATE_PROHIBITED
|
||||
end
|
||||
|
||||
def test_registry_lock_on_lockable_domain
|
||||
refute(@domain.locked_by_registrant?)
|
||||
@domain.apply_registry_lock
|
||||
|
|
|
@ -27,6 +27,16 @@ class DomainTest < ActiveSupport::TestCase
|
|||
assert domains(:invalid).invalid?
|
||||
end
|
||||
|
||||
def test_valid_domain_statuses_history
|
||||
@domain.force_delete_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED, DomainStatus::SERVER_TRANSFER_PROHIBITED]
|
||||
@domain.locked_domain_statuses_history = [DomainStatus::SERVER_UPDATE_PROHIBITED]
|
||||
assert @domain.valid?
|
||||
|
||||
assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverUpdateProhibited'
|
||||
assert @domain.json_statuses_history['force_delete_domain_statuses_history'].include? 'serverTransferProhibited'
|
||||
assert_equal @domain.json_statuses_history['locked_domain_statuses_history'], ['serverUpdateProhibited']
|
||||
end
|
||||
|
||||
# https://www.internet.ee/domeenid/ee-domeenireeglid#domeeninimede-registreerimine
|
||||
def test_validates_name_format
|
||||
assert_equal dns_zones(:one).origin, 'test'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue