mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 07:04:47 +02:00
added abbility for added extenstions prohibited status
This commit is contained in:
parent
f9436062a6
commit
1bb5dddd58
10 changed files with 32 additions and 25 deletions
|
@ -47,7 +47,7 @@ class RegistrantApiRegistryLocksTest < ApplicationIntegrationTest
|
|||
end
|
||||
|
||||
def test_cannot_lock_an_already_locked_domain
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert(@domain.locked_by_registrant?)
|
||||
|
||||
post '/api/v1/registrant/domains/2df2c1a1-8f6a-490a-81be-8bdf29866880/registry_lock',
|
||||
|
|
|
@ -22,14 +22,14 @@ class DomainUpdateConfirmJobTest < ActiveSupport::TestCase
|
|||
|
||||
def test_registrant_locked_domain
|
||||
refute @domain.locked_by_registrant?
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
assert_equal(@domain.registrar.notifications.last.text, "Domain #{@domain.name} has been locked by registrant")
|
||||
end
|
||||
|
||||
def test_registrant_unlocked_domain
|
||||
refute @domain.locked_by_registrant?
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
@domain.remove_registry_lock
|
||||
refute @domain.locked_by_registrant?
|
||||
|
|
|
@ -16,7 +16,7 @@ class SerializersRegistrantApiDomainTest < ActiveSupport::TestCase
|
|||
assert_not(@json[:locked_by_registrant_at])
|
||||
|
||||
travel_to Time.zone.parse('2010-07-05 10:30')
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
serializer_for_locked_domain = Serializers::RegistrantApi::Domain.new(@domain.reload)
|
||||
new_json = serializer_for_locked_domain.to_json
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class DomainVersionTest < ActiveSupport::TestCase
|
|||
PaperTrail.request.whodunnit = @user.id_role_username
|
||||
|
||||
assert_difference '@domain.versions.count', 1 do
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
end
|
||||
|
||||
assert_equal(@domain.updator, @user)
|
||||
|
|
|
@ -18,7 +18,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_remove_lockalable_statuses_after_admin_intervention
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort
|
||||
|
||||
|
@ -26,7 +26,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
@domain.update(statuses: deleted_status)
|
||||
assert_not @domain.locked_by_registrant?
|
||||
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
@domain.remove_registry_lock
|
||||
|
||||
|
@ -41,7 +41,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
@domain.save
|
||||
assert @domain.admin_store_statuses_history.include? DomainStatus::SERVER_UPDATE_PROHIBITED
|
||||
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort
|
||||
|
||||
|
@ -52,7 +52,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_add_additinal_status_for_locked_domain
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
assert @domain.locked_by_registrant?
|
||||
assert_equal @domain.statuses.sort, Domain::RegistryLockable::LOCK_STATUSES.sort
|
||||
|
||||
|
@ -69,7 +69,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
|
||||
def test_lockable_domain_if_remove_some_prohibited_status
|
||||
refute(@domain.locked_by_registrant?)
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
check_statuses_lockable_domain
|
||||
assert(@domain.locked_by_registrant?)
|
||||
|
||||
|
@ -85,7 +85,7 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
|
||||
def test_registry_lock_on_lockable_domain
|
||||
refute(@domain.locked_by_registrant?)
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
|
||||
assert_equal(
|
||||
[DomainStatus::SERVER_UPDATE_PROHIBITED,
|
||||
|
@ -99,21 +99,21 @@ class DomainRegistryLockableTest < ActiveSupport::TestCase
|
|||
end
|
||||
|
||||
def test_registry_lock_cannot_be_applied_twice
|
||||
@domain.apply_registry_lock
|
||||
refute(@domain.apply_registry_lock)
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
refute(@domain.apply_registry_lock(extensionsProhibited: false))
|
||||
assert(@domain.locked_by_registrant?)
|
||||
assert(@domain.locked_by_registrant_at)
|
||||
end
|
||||
|
||||
def test_registry_lock_cannot_be_applied_on_pending_statuses
|
||||
@domain.statuses << DomainStatus::PENDING_RENEW
|
||||
refute(@domain.apply_registry_lock)
|
||||
refute(@domain.apply_registry_lock(extensionsProhibited: false))
|
||||
refute(@domain.locked_by_registrant?)
|
||||
refute(@domain.locked_by_registrant_at)
|
||||
end
|
||||
|
||||
def test_remove_registry_lock_on_locked_domain
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
|
||||
assert_equal(
|
||||
[DomainStatus::SERVER_UPDATE_PROHIBITED,
|
||||
|
|
|
@ -17,7 +17,7 @@ class AdminAreaRegistryLockTest < JavaScriptApplicationSystemTestCase
|
|||
end
|
||||
|
||||
def test_can_remove_registry_lock_from_a_domain
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
|
||||
visit edit_admin_domain_path(@domain)
|
||||
click_link_or_button('Actions')
|
||||
|
@ -34,7 +34,7 @@ class AdminAreaRegistryLockTest < JavaScriptApplicationSystemTestCase
|
|||
end
|
||||
|
||||
def test_cannot_remove_registry_lock_from_not_locked_domain
|
||||
@domain.apply_registry_lock
|
||||
@domain.apply_registry_lock(extensionsProhibited: false)
|
||||
visit edit_admin_domain_path(@domain)
|
||||
@domain.remove_registry_lock
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ class AdminDomainsTestTest < ApplicationSystemTestCase
|
|||
refute_text 'Registry lock time 2010-07-05 00:30'
|
||||
|
||||
lockable_domain = domains(:airport)
|
||||
lockable_domain.apply_registry_lock
|
||||
lockable_domain.apply_registry_lock(extensionsProhibited: false)
|
||||
|
||||
visit admin_domain_path(lockable_domain)
|
||||
assert_text 'Registry lock time 2010-07-05 00:30'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue