Improve readability

This commit is contained in:
Artur Beljajev 2019-04-05 20:22:01 +03:00
parent ffe11685ff
commit eb1ee426ca
14 changed files with 48 additions and 47 deletions

View file

@ -6,31 +6,31 @@ class RegistrantChangeMailerPreview < ActionMailer::Preview
end
def confirmation_request
RegistrantChangeMailer.confirm(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @new_registrant)
RegistrantChangeMailer.confirmation_request(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @new_registrant)
end
def notification
RegistrantChangeMailer.notice(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @new_registrant)
RegistrantChangeMailer.notification(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @new_registrant)
end
def confirmation_accepted
RegistrantChangeMailer.confirmed(domain: @domain,
old_registrant: @domain.registrar)
def accepted
RegistrantChangeMailer.accepted(domain: @domain,
old_registrant: @domain.registrar)
end
def confirmation_rejected
def rejected
RegistrantChangeMailer.rejected(domain: @domain,
registrar: @domain.registrar,
registrant: @domain.registrant)
end
def confirmation_expired
def expired
RegistrantChangeMailer.expired(domain: @domain,
registrar: @domain.registrar,
registrant: @domain.registrant)

View file

@ -12,10 +12,11 @@ class RegistrantChangeMailerTest < ActiveSupport::TestCase
assert_equal 'shop.test', @domain.name
assert_equal 'john@inbox.test', @domain.registrant.email
email = RegistrantChangeMailer.confirm(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @domain.registrant).deliver_now
email = RegistrantChangeMailer.confirmation_request(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: @domain.registrant)
.deliver_now
assert_emails 1
assert_equal ['john@inbox.test'], email.to
@ -28,10 +29,10 @@ class RegistrantChangeMailerTest < ActiveSupport::TestCase
assert_equal 'shop.test', @domain.name
assert_equal 'william@inbox.test', new_registrant.email
email = RegistrantChangeMailer.notice(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: new_registrant).deliver_now
email = RegistrantChangeMailer.notification(domain: @domain,
registrar: @domain.registrar,
current_registrant: @domain.registrant,
new_registrant: new_registrant).deliver_now
assert_emails 1
assert_equal ['william@inbox.test'], email.to
@ -45,8 +46,8 @@ class RegistrantChangeMailerTest < ActiveSupport::TestCase
assert_equal 'john@inbox.test', @domain.registrant.email
assert_equal 'william@inbox.test', new_registrant.email
email = RegistrantChangeMailer.confirmed(domain: @domain,
old_registrant: new_registrant).deliver_now
email = RegistrantChangeMailer.accepted(domain: @domain,
old_registrant: new_registrant).deliver_now
assert_emails 1
assert_equal %w[john@inbox.test william@inbox.test], email.to