mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
Refactor domain mailer
- Remove `Que::Mailer` (#895) - Add preview - DRY templates - Add tests - Extract translations
This commit is contained in:
parent
6a61d7de5b
commit
4b91cf900f
21 changed files with 175 additions and 108 deletions
21
test/models/domain_cron_test.rb
Normal file
21
test/models/domain_cron_test.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
require 'test_helper'
|
||||
|
||||
class DomainCronTest < ActiveSupport::TestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
|
||||
def test_clean_expired_pendings_notifies_registrant_by_email
|
||||
Setting.expire_pending_confirmation = 0
|
||||
@domain.update!(registrant_verification_asked_at: Time.zone.now,
|
||||
registrant_verification_token: 'test',
|
||||
statuses: [DomainStatus::PENDING_DELETE_CONFIRMATION])
|
||||
|
||||
DomainCron.clean_expired_pendings
|
||||
|
||||
assert_emails 1
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue