updated tests

This commit is contained in:
olegphenomenon 2021-12-23 15:14:36 +02:00
parent ba48132547
commit d9f6274258
3 changed files with 73 additions and 89 deletions

View file

@ -29,31 +29,32 @@ class DomainExpireMailerTest < ActionMailer::TestCase
email.subject
end
def test_delivers_domain_expiration_soft_email_if_auto_fd
domain = domains(:shop)
email_address = domain.registrar.email
assert_not domain.force_delete_scheduled?
travel_to Time.zone.parse('2010-07-05')
email = '`@internet.ee'
Truemail.configure.default_validation_type = :regex
contact = domain.admin_contacts.first
contact.update_attribute(:email, email)
contact.verify_email
assert contact.email_verification_failed?
domain.reload
assert domain.force_delete_scheduled?
email = DomainExpireMailer.expired_soft(domain: domain,
registrar: domain.registrar,
email: email_address).deliver_now
assert_emails 1
assert_equal I18n.t("domain_expire_mailer.expired_soft.subject", domain_name: domain.name),
email.subject
end
# COMMENT OU REASON: FOR EXPIRED DOMAIN SHOULD NOT SET FD
# def test_delivers_domain_expiration_soft_email_if_auto_fd
# domain = domains(:shop)
# email_address = domain.registrar.email
# assert_not domain.force_delete_scheduled?
# travel_to Time.zone.parse('2010-07-05')
# email = '`@internet.ee'
#
# Truemail.configure.default_validation_type = :regex
#
# contact = domain.admin_contacts.first
# contact.update_attribute(:email, email)
# contact.verify_email
#
# assert contact.email_verification_failed?
#
# domain.reload
#
# assert_no domain.force_delete_scheduled?
#
# email = DomainExpireMailer.expired_soft(domain: domain,
# registrar: domain.registrar,
# email: email_address).deliver_now
#
# assert_emails 1
# assert_equal I18n.t("domain_expire_mailer.expired_soft.subject", domain_name: domain.name),
# email.subject
# end
end