internetee-registry/test/integration/registrant_area/domain_delete_confirmations.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

30 lines
No EOL
991 B
Ruby

require 'test_helper'
class RegistrantAreaDomainDeleteConfirmationIntegrationTest < ActionDispatch::IntegrationTest
include ActionMailer::TestHelper
setup do
@domain = domains(:shop)
ActionMailer::Base.deliveries.clear
end
def test_notifies_registrant_by_email_when_accepted
@domain.update!(registrant_verification_asked_at: Time.zone.now,
registrant_verification_token: 'test',
statuses: [DomainStatus::PENDING_DELETE_CONFIRMATION])
patch registrant_domain_delete_confirm_path(@domain, token: 'test', confirmed: true)
assert_emails 1
end
def test_notifies_registrant_by_email_when_rejected
@domain.update!(registrant_verification_asked_at: Time.zone.now,
registrant_verification_token: 'test',
statuses: [DomainStatus::PENDING_DELETE_CONFIRMATION])
patch registrant_domain_delete_confirm_path(@domain, token: 'test', rejected: true)
assert_emails 1
end
end