update contact notification

This commit is contained in:
olegphenomenon 2022-01-05 15:58:32 +02:00
parent 374c434de4
commit d4fd8dc0ee
2 changed files with 39 additions and 1 deletions

View file

@ -7,7 +7,7 @@ module ContactNotification
def notify_tech_contact(domain:) def notify_tech_contact(domain:)
text = "DNSKEYS for #{domain.name} are invalid!" text = "DNSKEYS for #{domain.name} are invalid!"
domain.tech_domain_contacts.each do |tech| domain.tech_contacts.each do |tech|
contact = Contact.find(tech.id) contact = Contact.find(tech.id)
ContactInformMailer.notify(contact: contact, subject: text) ContactInformMailer.notify(contact: contact, subject: text)

View file

@ -0,0 +1,38 @@
$VERBOSE=nil
require 'test_helper'
class ValidateDnssecJobTest < ActiveJob::TestCase
setup do
@domain = domains(:shop)
@dnskey = dnskeys(:one)
end
# def test_job_should_return_successfully_validated_dnskeys
# @domain.dnskeys << @dnskey
# @domain.save
# @domain.reload
#
# mock_zone_data = [
# {
# flags: @dnskey.flags,
# protocol: @dnskey.protocol,
# alg: @dnskey.alg,
# public_key: @dnskey.public_key
# }]
#
# Spy.on_instance_method(ValidateDnssecJob, :parse_response).and_return(mock_zone_data)
#
# ValidateDnssecJob.perform_now(domain_name: @domain.name)
#
# @domain.reload
# p @domain.dnskeys
# end
# def test_job_discarded_after_error
# assert_no_enqueued_jobs
# assert_performed_jobs 1 do
# TestDiscardedJob.perform_later
# end
# assert_no_enqueued_jobs
# end
end