mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 19:20:37 +02:00
Merge pull request #1166 from internetee/refactor-domain-mailer
Refactor domain mailer
This commit is contained in:
commit
718bcbcea6
21 changed files with 175 additions and 108 deletions
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue