mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
update contact notification
This commit is contained in:
parent
374c434de4
commit
d4fd8dc0ee
2 changed files with 39 additions and 1 deletions
|
@ -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)
|
||||||
|
|
38
test/jobs/validate_dnssec_job_test.rb
Normal file
38
test/jobs/validate_dnssec_job_test.rb
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue