mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Merge pull request #1731 from internetee/1729-fix-confirmations-on-ForceDelete
Remove ForceDelete from statuses blocking confirmation
This commit is contained in:
commit
e4679b9de9
2 changed files with 13 additions and 1 deletions
|
@ -384,7 +384,7 @@ class Domain < ApplicationRecord
|
|||
end
|
||||
|
||||
def registrant_update_confirmable?(token)
|
||||
return false if (statuses & [DomainStatus::FORCE_DELETE, DomainStatus::DELETE_CANDIDATE]).any?
|
||||
return false if statuses.include? DomainStatus::DELETE_CANDIDATE
|
||||
return false unless pending_update?
|
||||
return false unless registrant_verification_asked?
|
||||
return false unless registrant_verification_token == token
|
||||
|
|
|
@ -252,4 +252,16 @@ class NewDomainForceDeleteTest < ActiveSupport::TestCase
|
|||
assert @domain.force_delete_scheduled?
|
||||
assert @domain.pending_update?
|
||||
end
|
||||
|
||||
def test_force_delete_does_not_affect_registrant_update_confirmable
|
||||
@domain.schedule_force_delete(type: :soft)
|
||||
@domain.registrant_verification_asked!('test', User.last.id)
|
||||
@domain.save!
|
||||
@domain.reload
|
||||
|
||||
@domain.statuses << DomainStatus::PENDING_UPDATE
|
||||
|
||||
assert @domain.force_delete_scheduled?
|
||||
assert @domain.registrant_update_confirmable?(@domain.registrant_verification_token)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue