mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +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
|
@ -0,0 +1,38 @@
|
|||
require 'test_helper'
|
||||
|
||||
class NotifyAccreditationAdminsAndRegistrarsJobTest < ActiveJob::TestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
|
||||
def test_inform_registrars_if_accredation_date_is_expires
|
||||
api_user = users(:api_bestnames)
|
||||
api_user.accreditation_date = Time.now - 2.year - 1.day
|
||||
api_user.accreditation_expire_date = Time.now - 1.day
|
||||
api_user.save
|
||||
api_user.reload
|
||||
|
||||
perform_enqueued_jobs do
|
||||
NotifyAccreditationAdminsAndRegistrarsJob.perform_now
|
||||
end
|
||||
|
||||
assert_emails 1
|
||||
end
|
||||
|
||||
# def test_inform_registrars_if_deadline_date_in_one_month
|
||||
# api_user = users(:api_bestnames)
|
||||
# api_user.accreditation_date = Time.now - 2.year - 1.day
|
||||
# api_user.accreditation_expire_date = Time.now + 1.month - 1.day
|
||||
# api_user.save
|
||||
# api_user.reload
|
||||
#
|
||||
# perform_enqueued_jobs do
|
||||
# NotifyAccreditationAdminsAndRegistrarsJob.perform_now
|
||||
# end
|
||||
#
|
||||
# assert_emails 1
|
||||
# end
|
||||
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue