mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Merge pull request #2212 from internetee/added_notifications_for_acc_center
added mail contronller and job for notificate registrars and admins about accreditation expire date
This commit is contained in:
commit
4ccbbd2292
10 changed files with 167 additions and 4 deletions
40
test/mailers/accrediation_center_mailer_test.rb
Normal file
40
test/mailers/accrediation_center_mailer_test.rb
Normal file
|
@ -0,0 +1,40 @@
|
|||
require 'test_helper'
|
||||
|
||||
class AccreditationCenterMailerTest < ActionMailer::TestCase
|
||||
setup do
|
||||
@admin = users(:admin)
|
||||
@registrar = registrars(:bestnames)
|
||||
end
|
||||
|
||||
def test_send_mails_for_admins
|
||||
email = AccreditationCenterMailer.test_was_successfully_passed_admin(@admin.email)
|
||||
.deliver_now
|
||||
|
||||
assert_emails 1
|
||||
assert_equal [@admin.email], email.to
|
||||
end
|
||||
|
||||
def test_send_mails_for_registrar
|
||||
email = AccreditationCenterMailer.test_was_successfully_passed_registrar(@registrar.email)
|
||||
.deliver_now
|
||||
|
||||
assert_emails 1
|
||||
assert_equal [@registrar.email], email.to
|
||||
end
|
||||
|
||||
def test_send_mails_month_before
|
||||
email = AccreditationCenterMailer.test_results_will_expired_in_one_month(@registrar.email)
|
||||
.deliver_now
|
||||
|
||||
assert_emails 1
|
||||
assert_equal [@registrar.email], email.to
|
||||
end
|
||||
|
||||
def test_send_mails_if_accredation_date_is_expired
|
||||
email = AccreditationCenterMailer.test_results_are_expired(@registrar.email)
|
||||
.deliver_now
|
||||
|
||||
assert_emails 1
|
||||
assert_equal [@registrar.email], email.to
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue