Add tests

This commit is contained in:
Alex Sherman 2020-11-05 13:32:45 +05:00
parent 0116531786
commit 6a4bb6079d
4 changed files with 22 additions and 12 deletions

View file

@ -44,7 +44,7 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
end
@domain.reload
assert_equal template_name, @domain.template_name
assert_equal @domain.notification_template, @domain.template_name
end
def test_uses_legal_template_if_registrant_org
@ -57,7 +57,23 @@ class AdminAreaDomainForceDeleteTest < ApplicationSystemTestCase
end
@domain.reload
assert_equal template_name, @domain.template_name
assert_equal @domain.notification_template, @domain.template_name
end
def test_uses_legal_template_if_invalid_email
verification = @domain.contacts.first.email_verification
verification.update(verified_at: Time.zone.now - 1.day, success: false)
assert_equal @domain.notification_template, 'invalid_email'
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 @domain.notification_template, @domain.template_name
end
def test_allows_to_skip_notifying_registrant_and_admin_contacts_by_email
@ -87,10 +103,4 @@ 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