improve notification feature

This commit is contained in:
olegphenomenon 2022-01-10 12:05:32 +02:00
parent 053382ffa3
commit 35f60e53e5
5 changed files with 37 additions and 16 deletions

View file

@ -0,0 +1,22 @@
require 'test_helper'
class ContactNotificationTest < ActionMailer::TestCase
setup do
@domain = domains(:shop)
@text = 'text'
end
def test_notify_registrar
assert_difference -> { @domain.registrar.notifications.count } do
ContactNotification.notify_registrar(domain: @domain, text: @text)
end
end
def test_notify_tech_contacts
ContactNotification.notify_tech_contact(domain: @domain, text: @text)
assert_equal @domain.tech_contacts.count, 2
assert_emails 2
end
end