Merge pull request #1166 from internetee/refactor-domain-mailer

Refactor domain mailer
This commit is contained in:
Timo Võhmar 2019-04-23 13:05:10 +03:00 committed by GitHub
commit 718bcbcea6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 175 additions and 108 deletions

View file

@ -0,0 +1,30 @@
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