mirror of
https://github.com/internetee/registry.git
synced 2025-08-04 08:52:04 +02:00
Refactor contact mailer
- Send single email with new email in `to` and old email in `bcc` fields - Remove `Que::Mailer` (#895) - Add preview - DRY templates - Add tests - Extract translations - Remove useless specs
This commit is contained in:
parent
6fa1ce9128
commit
5674071838
12 changed files with 122 additions and 125 deletions
24
test/mailers/contact_mailer_test.rb
Normal file
24
test/mailers/contact_mailer_test.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ContactMailerTest < ActiveSupport::TestCase
|
||||
include ActionMailer::TestHelper
|
||||
|
||||
setup do
|
||||
@contact = contacts(:john)
|
||||
ActionMailer::Base.deliveries.clear
|
||||
end
|
||||
|
||||
def test_delivers_email_changed_email
|
||||
assert_equal 'john-001', @contact.code
|
||||
assert_equal 'john@inbox.test', @contact.email
|
||||
|
||||
email = ContactMailer.email_changed(contact: @contact, old_email: 'john-old@inbox.test')
|
||||
.deliver_now
|
||||
|
||||
assert_emails 1
|
||||
assert_equal %w[john@inbox.test], email.to
|
||||
assert_equal %w[john-old@inbox.test], email.bcc
|
||||
assert_equal 'Teie domeenide kontakt epostiaadress on muutunud' \
|
||||
' / Contact e-mail addresses of your domains have changed [john-001]', email.subject
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue