-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Remove `Que::Mailer` (#895) - Add preview - DRY templates - Add tests - Extract translations
- Loading branch information
Artur Beljajev
committed
Apr 14, 2019
1 parent
6fa1ce9
commit 719c46c
Showing
22 changed files
with
211 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
...omain_mailer/delete_confirmation.html.erb → ...rs/domain_delete_mailer/accepted.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
Tere | ||
<br><br> | ||
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija poolt kinnitatud. Domeen <%= @domain.name %> on peatatud ja kustub registrist. | ||
<br><br> | ||
Lugupidamisega<br> | ||
Eesti Interneti Sihtasutus | ||
<br><br> | ||
<%= render 'mailers/shared/signatures/signature.et.html' %> | ||
<hr> | ||
<br><br> | ||
Hi, | ||
<br><br> | ||
Domain <%= @domain.name %> deletion is confirmed by the registrant. Domain <%= @domain.name %> is suspended and will be deleted. | ||
<br><br> | ||
Best Regards,<br> | ||
Estonian Internet Foundation | ||
<%= render 'mailers/shared/signatures/signature.en.html' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
9 changes: 2 additions & 7 deletions
9
...ding_delete_expired_notification.html.erb → ...ers/domain_delete_mailer/expired.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
Tere | ||
<br><br> | ||
Domeeni <%= @domain.name %> kustutamise taotlust ei kinnitatud tähtaegselt registreerija <%= @domain.registrant.name %> poolt. Domeeni <%= @domain.name %> kustutamine on sellest tulenevalt tühistatud. | ||
<br><br> | ||
Lugupidamisega<br> | ||
Eesti Interneti Sihtasutus | ||
<br><br> | ||
<%= render 'mailers/shared/signatures/signature.et.html' %> | ||
<hr> | ||
<br><br> | ||
Hi, | ||
<br><br> | ||
Domain <%= @domain.name %> deletion was not approved in time by the registrant <%= @domain.registrant.name %>. Thus the deletion of domain <%= @domain.name %> is cancelled. | ||
<br><br> | ||
Best Regards,<br> | ||
Estonian Internet Foundation | ||
<%= render 'mailers/shared/signatures/signature.en.html' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 2 additions & 7 deletions
9
...ing_delete_rejected_notification.html.erb → ...rs/domain_delete_mailer/rejected.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
Tere | ||
<br><br> | ||
Domeeni <%= @domain.name %> kustutamise taotlus on registreerija <%= @domain.registrant.name %> poolt tagasi lükatud. | ||
<br><br> | ||
Lugupidamisega<br> | ||
Eesti Interneti Sihtasutus | ||
<br><br> | ||
<%= render 'mailers/shared/signatures/signature.et.html' %> | ||
<hr> | ||
<br><br> | ||
Hi, | ||
<br><br> | ||
Domain <%= @domain.name %> deletion was rejected by the registrant <%= @domain.registrant.name %>. | ||
<br><br> | ||
Best Regards,<br> | ||
Estonian Internet Foundation | ||
<%= render 'mailers/shared/signatures/signature.en.html' %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require 'test_helper' | ||
|
||
class EppDomainDeleteBaseTest < ApplicationIntegrationTest | ||
include ActionMailer::TestHelper | ||
|
||
setup do | ||
@domain = domains(:shop) | ||
ActionMailer::Base.deliveries.clear | ||
end | ||
|
||
def test_requests_registrant_confirmation_by_email | ||
assert_equal 'shop.test', @domain.name | ||
|
||
request_xml = <<-XML | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd"> | ||
<command> | ||
<delete> | ||
<domain:delete xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd"> | ||
<domain:name>shop.test</domain:name> | ||
</domain:delete> | ||
</delete> | ||
<extension> | ||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd"> | ||
<eis:legalDocument type="pdf">dGVzdCBmYWlsCg==</eis:legalDocument> | ||
</eis:extdata> | ||
</extension> | ||
</command> | ||
</epp> | ||
XML | ||
|
||
post '/epp/command/delete', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames' | ||
|
||
assert_emails 1 | ||
end | ||
end |
30 changes: 30 additions & 0 deletions
30
test/integration/registrant_area/domain_delete_confirmations.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
Oops, something went wrong.