Merge pull request #1544 from internetee/1543-fix-domain-statuses-removal

Fix domain statuses removal
This commit is contained in:
Timo Võhmar 2020-02-26 17:20:43 +02:00 committed by GitHub
commit 1b8f393ffe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -485,9 +485,9 @@ class Domain < ApplicationRecord
self.delete_date = nil
when DomainStatus::SERVER_MANUAL_INZONE # removal causes server hold to set
self.outzone_at = Time.zone.now if force_delete_scheduled?
when DomainStatus::DomainStatus::EXPIRED # removal causes server hold to set
when DomainStatus::EXPIRED # removal causes server hold to set
self.outzone_at = self.expire_time + 15.day
when DomainStatus::DomainStatus::SERVER_HOLD # removal causes server hold to set
when DomainStatus::SERVER_HOLD # removal causes server hold to set
self.outzone_at = nil
end
end

View file

@ -35,4 +35,15 @@ class AdminDomainsTestTest < ApplicationSystemTestCase
assert_text 'deleteCandidate status has been removed'
assert_no_link 'Remove deleteCandidate status'
end
def test_remove_domain_status
@domain.update!(statuses: [DomainStatus::SERVER_REGISTRANT_CHANGE_PROHIBITED])
visit edit_admin_domain_url(@domain)
click_link_or_button 'Delete'
click_link_or_button 'Save'
assert_text 'Domain updated!'
end
end