Merge pull request #1730 from internetee/442-forcedelete-notification-template-selection

Auto-select email template
This commit is contained in:
Timo Võhmar 2020-11-04 16:26:49 +02:00 committed by GitHub
commit b3c5aa2d41
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 9 deletions

View file

@ -42,6 +42,22 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
find(:css, '#soft_delete').set(true)
click_link_or_button 'Force delete domain'
end
@domain.reload
assert_equal template_name, @domain.template_name
end
def test_uses_legal_template_if_registrant_org
@domain.registrant.update(ident_type: 'org')
assert_emails 0 do
visit edit_admin_domain_url(@domain)
find(:css, '#soft_delete').set(true)
click_link_or_button 'Force delete domain'
end
@domain.reload
assert_equal template_name, @domain.template_name
end
def test_allows_to_skip_notifying_registrant_and_admin_contacts_by_email
@ -71,4 +87,10 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
assert_no_button 'Schedule force delete'
assert_no_link 'Schedule force delete'
end
private
def template_name
@domain.registrant.org? ? 'legal_person' : 'private_person'
end
end