mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
refactored task
This commit is contained in:
parent
651f542fcb
commit
41ee61d57a
7 changed files with 67 additions and 74 deletions
|
@ -13,7 +13,7 @@ class ReplaceUpdToObjUpdProhibitedJobTest < ActiveSupport::TestCase
|
|||
assert @domain.locked_by_registrant?
|
||||
|
||||
perform_enqueued_jobs do
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later(action: :add)
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later
|
||||
end
|
||||
|
||||
@domain.reload
|
||||
|
@ -25,14 +25,14 @@ class ReplaceUpdToObjUpdProhibitedJobTest < ActiveSupport::TestCase
|
|||
assert @domain.locked_by_registrant?
|
||||
assert @domain.statuses.include? "serverUpdateProhibited"
|
||||
|
||||
@domain.statuses += ["serverObjUpdateProhibited"]
|
||||
@domain.save
|
||||
@domain.reload
|
||||
# @domain.statuses += ["serverObjUpdateProhibited"]
|
||||
# @domain.save
|
||||
# @domain.reload
|
||||
|
||||
assert @domain.statuses.include? "serverObjUpdateProhibited"
|
||||
# assert @domain.statuses.include? "serverObjUpdateProhibited"
|
||||
|
||||
perform_enqueued_jobs do
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later(action: :remove)
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later
|
||||
end
|
||||
|
||||
@domain.reload
|
||||
|
@ -49,7 +49,7 @@ class ReplaceUpdToObjUpdProhibitedJobTest < ActiveSupport::TestCase
|
|||
assert_not @domain.locked_by_registrant?
|
||||
|
||||
perform_enqueued_jobs do
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later(action: :add)
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later
|
||||
end
|
||||
|
||||
assert_not @domain.statuses.include? "serverObjUpdateProhibited"
|
||||
|
@ -64,7 +64,7 @@ class ReplaceUpdToObjUpdProhibitedJobTest < ActiveSupport::TestCase
|
|||
assert_not @domain.locked_by_registrant?
|
||||
|
||||
perform_enqueued_jobs do
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later(action: :remove)
|
||||
ReplaceUpdToObjUpdProhibitedJob.perform_later
|
||||
end
|
||||
|
||||
assert @domain.statuses.include? "serverUpdateProhibited"
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
require 'test_helper'
|
||||
|
||||
class FeatureTest < ActiveSupport::TestCase
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
@domain.apply_registry_lock
|
||||
end
|
||||
|
||||
def test_if_obj_and_extensions_prohibited_enabled
|
||||
ENV['obj_and_extensions_prohibited'] = 'true'
|
||||
|
||||
|
@ -27,4 +32,22 @@ class FeatureTest < ActiveSupport::TestCase
|
|||
statuses = DomainStatus.admin_statuses
|
||||
assert_not statuses.include? DomainStatus::SERVER_OBJ_UPDATE_PROHIBITED
|
||||
end
|
||||
|
||||
def test_if_enable_lock_domain_with_new_statuses_is_nil
|
||||
ENV['enable_lock_domain_with_new_statuses'] = nil
|
||||
|
||||
assert_not Feature.enable_lock_domain_with_new_statuses?
|
||||
|
||||
assert_equal @domain.statuses, ["serverUpdateProhibited", "serverDeleteProhibited", "serverTransferProhibited"]
|
||||
assert @domain.locked_by_registrant?
|
||||
end
|
||||
|
||||
def test_if_enable_lock_domain_with_new_statuses_is_false
|
||||
ENV['enable_lock_domain_with_new_statuses'] = 'false'
|
||||
|
||||
assert_not Feature.enable_lock_domain_with_new_statuses?
|
||||
|
||||
assert_equal @domain.statuses, ["serverUpdateProhibited", "serverDeleteProhibited", "serverTransferProhibited"]
|
||||
assert @domain.locked_by_registrant?
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue