internetee-registry/test/models/domain_cron_test.rb
Artur Beljajev 4b91cf900f Refactor domain mailer
- Remove `Que::Mailer` (#895)
- Add preview
- DRY templates
- Add tests
- Extract translations
2019-04-19 17:06:26 +03:00

21 lines
No EOL
572 B
Ruby

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