mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
parent
789468c84f
commit
962e98317d
31 changed files with 332 additions and 366 deletions
|
@ -21,10 +21,7 @@ Registrikood: <b><%= @registrant.ident %></b></p>
|
|||
|
||||
<p>Lisaküsimuste korral võtke palun ühendust oma registripidajaga:</p>
|
||||
|
||||
<p><%= @registrar.name %><br>
|
||||
Email: <%= @registrar.email %><br>
|
||||
Telefon: <%= @registrar.phone %><br>
|
||||
Veebileht: <%= @registrar.url %></p>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.et.html', registrar: @registrar %>
|
||||
|
||||
<hr>
|
||||
|
||||
|
@ -45,10 +42,7 @@ Registry code: <b><%= @registrant.ident %></b></p>
|
|||
|
||||
<p>Should you have additional questions, please contact your registrar:</p>
|
||||
|
||||
<p><%= @registrar.name %><br>
|
||||
Email: <%= @registrar.email %><br>
|
||||
Phone: <%= @registrar.phone %><br>
|
||||
Website: <%= @registrar.url %></p>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.en.html', registrar: @registrar %>
|
||||
|
||||
<hr>
|
||||
|
||||
|
@ -69,10 +63,7 @@ Website: <%= @registrar.url %></p>
|
|||
|
||||
<p>Просим обратиться к своему регистратору:</p>
|
||||
|
||||
<p><%= @registrar.name %><br>
|
||||
Электронная почта: <%= @registrar.email %><br>
|
||||
Телефон: <%= @registrar.phone %><br>
|
||||
Веб-сайт: <%= @registrar.url %></p>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.ru.html', registrar: @registrar %>
|
||||
|
||||
|
||||
<br /><br />
|
||||
|
|
|
@ -15,10 +15,7 @@ Kui üleandmine ei ole 30 päeva jooksul toimunud, kustub domeen <%= @domain.nam
|
|||
|
||||
Lisaküsimuste korral võtke palun ühendust oma registripidajaga:
|
||||
|
||||
<%= @registrar.name %>
|
||||
Email: <%= @registrar.email %>
|
||||
Telefon: <%= @registrar.phone %>
|
||||
Veebileht: <%= @registrar.url %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.et.text', registrar: @registrar %>
|
||||
|
||||
|
||||
|
||||
|
@ -39,11 +36,7 @@ If the transfer has not been made in 30 days, the domain <%= @domain.name %> wil
|
|||
|
||||
Should you have additional questions, please contact your registrar:
|
||||
|
||||
<%= @registrar.name %>
|
||||
Email: <%= @registrar.email %>
|
||||
Phone: <%= @registrar.phone %>
|
||||
Website: <%= @registrar.url %>
|
||||
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.en.text', registrar: @registrar %>
|
||||
|
||||
|
||||
Уважаемое контактное лицо домена <%= @domain.name %>
|
||||
|
@ -63,10 +56,7 @@ EIS стало известно, что юридическое лицо с ре
|
|||
|
||||
Просим обратиться к своему регистратору:
|
||||
|
||||
<%= @registrar.name %>
|
||||
Электронная почта: <%= @registrar.email %>
|
||||
Телефон: <%= @registrar.phone %>
|
||||
Веб-сайт: <%= @registrar.url %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.ru.text', registrar: @registrar %>
|
||||
|
||||
|
||||
Lugupidamisega,
|
||||
|
|
|
@ -2,11 +2,11 @@ Tere
|
|||
<br><br>
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole:
|
||||
|
||||
<%= render 'registrar.et.html', registrar: @registrar %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.et.html', registrar: @registrar %>
|
||||
|
||||
<br><br>
|
||||
Uue registreerija andmed:<br>
|
||||
<%= render 'registrant.et.html', registrant: @registrant %>
|
||||
<%= render 'mailers/domain_mailer/registrant/registrant.et.html', registrant: @new_registrant %>
|
||||
<br><br>
|
||||
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ei kinnita või tagasi lükka.
|
||||
<br><br>
|
||||
|
@ -23,11 +23,11 @@ Hi,
|
|||
<br><br>
|
||||
Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. In case of problems please turn to your registrar:
|
||||
|
||||
<%= render 'registrar.en.html', registrar: @registrar %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.en.html', registrar: @registrar %>
|
||||
|
||||
<br><br>
|
||||
New registrant:<br>
|
||||
<%= render 'registrant.en.html', registrant: @registrant %>
|
||||
<%= render 'mailers/domain_mailer/registrant/registrant.en.html', registrant: @new_registrant %>
|
||||
<br><br>
|
||||
The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
|
||||
<br><br>
|
||||
|
|
|
@ -2,10 +2,10 @@ Tere
|
|||
|
||||
Registrisse laekus taotlus domeeni <%= @domain.name %> registreerija vahetuseks. Palun veenduge, et muudatus on korrektne ning probleemide korral pöörduge oma registripidaja poole:
|
||||
|
||||
<%= render 'registrar.et.text', registrar: @registrar %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.et.text', registrar: @registrar %>
|
||||
|
||||
Uue registreerija andmed:
|
||||
<%= render 'registrant.et.text', registrant: @registrant %>
|
||||
<%= render 'mailers/domain_mailer/registrant/registrant.et.text', registrant: @new_registrant %>
|
||||
|
||||
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ei kinnita või tagasi lükka.
|
||||
Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
|
||||
|
@ -20,10 +20,10 @@ Hi,
|
|||
|
||||
Application for changing registrant of your domain <%= @domain.name %> has been filed. Please make sure that the update and information are correct. In case of problems please turn to your registrar:
|
||||
|
||||
<%= render 'registrar.en.text', registrar: @registrar %>
|
||||
<%= render 'mailers/domain_mailer/registrar/registrar.en.text', registrar: @registrar %>
|
||||
|
||||
New registrant:
|
||||
<%= render 'registrant.en.text', registrant: @registrant %>
|
||||
<%= render 'mailers/domain_mailer/registrant/registrant.en.text', registrant: @new_registrant %>
|
||||
|
||||
The application will remain in pending status for <%= Setting.expire_pending_confirmation %> hrs and will be automaticcally rejected if it is not approved nor rejected before.
|
||||
To confirm the update please visit this website, once again review the data and press approve:
|
||||
|
|
|
@ -1,53 +1,12 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'expiration_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/expiration.html.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.html' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.html' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.ru.html' => 'test registrar russian'
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has registrar info in russian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar russian')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 4 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
on_hold_date
|
||||
delete_date
|
||||
registrant_name
|
||||
admin_contact_names
|
||||
tech_contact_names
|
||||
nameserver_names
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
include_examples 'domain mailer expiration'
|
||||
end
|
||||
|
|
|
@ -1,53 +1,12 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'expiration_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/expiration.text.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.text' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.text' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.ru.text' => 'test registrar russian'
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has registrar info in russian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar russian')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 4 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
on_hold_date
|
||||
delete_date
|
||||
registrant_name
|
||||
admin_contact_names
|
||||
tech_contact_names
|
||||
nameserver_names
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
include_examples 'domain mailer expiration'
|
||||
end
|
||||
|
|
53
spec/views/mailers/domain_mailer/expiration_shared.rb
Normal file
53
spec/views/mailers/domain_mailer/expiration_shared.rb
Normal file
|
@ -0,0 +1,53 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer expiration' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, registrar)
|
||||
assign(:registrant, registrant)
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has registrar info in russian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar russian')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 4 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
on_hold_date
|
||||
delete_date
|
||||
registrant_name
|
||||
admin_contact_names
|
||||
tech_contact_names
|
||||
nameserver_names
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,63 +1,12 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'force_delete_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/force_delete.html.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, registrar)
|
||||
assign(:registrant, registrant)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.html' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.html' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.ru.html' => 'test registrar russian'
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 5 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has domain force delete date' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:force_delete_date).exactly(mention_count).times.and_return('test domain force delete date')
|
||||
render
|
||||
expect(rendered).to have_text('test domain force delete date', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has registrar name' do
|
||||
mention_count = 2 * lang_count
|
||||
expect(registrar).to receive(:name).exactly(mention_count).times.and_return('test registrar name')
|
||||
render
|
||||
expect(rendered).to have_text('test registrar name', count: mention_count)
|
||||
end
|
||||
|
||||
registrar_attributes = %i(
|
||||
email
|
||||
phone
|
||||
url
|
||||
)
|
||||
|
||||
registrar_attributes.each do |attr_name|
|
||||
it "has registrar #{attr_name}" do
|
||||
expect(registrar).to receive(attr_name).exactly(lang_count).times.and_return("test registrar #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test registrar #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
|
||||
it 'has registrant name' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(registrant).to receive(:name).exactly(mention_count).times.and_return('test registrant name')
|
||||
render
|
||||
expect(rendered).to have_text('test registrant name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has registrant ident' do
|
||||
mention_count = 2 * lang_count
|
||||
expect(registrant).to receive(:ident).exactly(mention_count).times.and_return('test registrant ident')
|
||||
render
|
||||
expect(rendered).to have_text('test registrant ident', count: mention_count)
|
||||
end
|
||||
include_examples 'domain mailer force delete'
|
||||
end
|
||||
|
|
|
@ -1,63 +1,12 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'force_delete_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/force_delete.text.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, registrar)
|
||||
assign(:registrant, registrant)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.text' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.text' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.ru.text' => 'test registrar russian'
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 5 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has domain force delete date' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:force_delete_date).exactly(mention_count).times.and_return('test domain force delete date')
|
||||
render
|
||||
expect(rendered).to have_text('test domain force delete date', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has registrar name' do
|
||||
mention_count = 2 * lang_count
|
||||
expect(registrar).to receive(:name).exactly(mention_count).times.and_return('test registrar name')
|
||||
render
|
||||
expect(rendered).to have_text('test registrar name', count: mention_count)
|
||||
end
|
||||
|
||||
registrar_attributes = %i(
|
||||
email
|
||||
phone
|
||||
url
|
||||
)
|
||||
|
||||
registrar_attributes.each do |attr_name|
|
||||
it "has registrar #{attr_name}" do
|
||||
expect(registrar).to receive(attr_name).exactly(lang_count).times.and_return("test registrar #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test registrar #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
|
||||
it 'has registrant name' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(registrant).to receive(:name).exactly(mention_count).times.and_return('test registrant name')
|
||||
render
|
||||
expect(rendered).to have_text('test registrant name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has registrant ident' do
|
||||
mention_count = 2 * lang_count
|
||||
expect(registrant).to receive(:ident).exactly(mention_count).times.and_return('test registrant ident')
|
||||
render
|
||||
expect(rendered).to have_text('test registrant ident', count: mention_count)
|
||||
end
|
||||
include_examples 'domain mailer force delete'
|
||||
end
|
||||
|
|
43
spec/views/mailers/domain_mailer/force_delete_shared.rb
Normal file
43
spec/views/mailers/domain_mailer/force_delete_shared.rb
Normal file
|
@ -0,0 +1,43 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer force delete' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
let(:lang_count) { 3 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, registrar)
|
||||
assign(:registrant, registrant)
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has registrar info in russian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar russian')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 5 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has domain force delete date' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:force_delete_date).exactly(mention_count).times.and_return('test domain force delete date')
|
||||
render
|
||||
expect(rendered).to have_text('test domain force delete date', count: mention_count)
|
||||
end
|
||||
end
|
|
@ -1,37 +1,11 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_deleted_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_deleted.html.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.html' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.html' => 'test registrar english'
|
||||
assign(:verification_url, 'test verification url')
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
include_examples 'domain mailer pending deleted'
|
||||
end
|
||||
|
|
|
@ -1,37 +1,11 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_deleted_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_deleted.text.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.text' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.text' => 'test registrar english'
|
||||
assign(:verification_url, 'test verification url')
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
include_examples 'domain mailer pending deleted'
|
||||
end
|
||||
|
|
35
spec/views/mailers/domain_mailer/pending_deleted_shared.rb
Normal file
35
spec/views/mailers/domain_mailer/pending_deleted_shared.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer pending deleted' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
assign(:verification_url, 'test verification url')
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has domain name' do
|
||||
mention_count = 1 * lang_count
|
||||
expect(domain).to receive(:name).exactly(mention_count).times.and_return('test domain name')
|
||||
render
|
||||
expect(rendered).to have_text('test domain name', count: mention_count)
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
end
|
|
@ -1,22 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_update_notification_for_new_registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_update_notification_for_new_registrant.html.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
include_examples 'domain mailer pending update notification for new registrant'
|
||||
end
|
||||
|
|
|
@ -1,22 +1,9 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_update_notification_for_new_registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_update_notification_for_new_registrant.text.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
include_examples 'domain mailer pending update notification for new registrant'
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -0,0 +1,40 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer pending update notification for new registrant' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, registrar)
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has registrar name' do
|
||||
expect(registrar).to receive(:name).and_return('test registrar name')
|
||||
render
|
||||
expect(rendered).to have_text('test registrar name')
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return("test domain #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test domain #{attr_name}", count: lang_count)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -1,29 +1,13 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_update_request_for_old_registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_update_request_for_old_registrant.html.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:verification_url, 'test verification url')
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.html' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.html' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrant/_registrant.et.html' => 'test new registrant estonian'
|
||||
stub_template 'mailers/domain_mailer/registrant/_registrant.en.html' => 'test new registrant english'
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has :#{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return(attr_name.to_s)
|
||||
render
|
||||
expect(rendered).to have_text(attr_name.to_s, count: lang_count)
|
||||
end
|
||||
end
|
||||
include_examples 'domain mailer pending update request for old registrant'
|
||||
end
|
||||
|
|
|
@ -1,29 +1,13 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'pending_update_request_for_old_registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/pending_update_request_for_old_registrant.text.erb' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:verification_url, 'test verification url')
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.et.text' => 'test registrar estonian'
|
||||
stub_template 'mailers/domain_mailer/registrar/_registrar.en.text' => 'test registrar english'
|
||||
stub_template 'mailers/domain_mailer/registrant/_registrant.et.text' => 'test new registrant estonian'
|
||||
stub_template 'mailers/domain_mailer/registrant/_registrant.en.text' => 'test new registrant english'
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has :#{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return(attr_name.to_s)
|
||||
render
|
||||
expect(rendered).to have_text(attr_name.to_s, count: lang_count)
|
||||
end
|
||||
end
|
||||
include_examples 'domain mailer pending update request for old registrant'
|
||||
end
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer pending update request for old registrant' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
assign(:new_registrant, nil)
|
||||
assign(:verification_url, 'test verification url')
|
||||
end
|
||||
|
||||
it 'has registrar info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar estonian')
|
||||
end
|
||||
|
||||
it 'has registrar info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test registrar english')
|
||||
end
|
||||
|
||||
it 'has new registrant info in estonian' do
|
||||
render
|
||||
expect(rendered).to have_text('test new registrant estonian')
|
||||
end
|
||||
|
||||
it 'has new registrant info in english' do
|
||||
render
|
||||
expect(rendered).to have_text('test new registrant english')
|
||||
end
|
||||
|
||||
it 'has verification url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test verification url', count: mention_count)
|
||||
end
|
||||
|
||||
domain_attributes = %i(
|
||||
name
|
||||
)
|
||||
|
||||
domain_attributes.each do |attr_name|
|
||||
it "has domain #{attr_name}" do
|
||||
expect(domain).to receive(attr_name).exactly(lang_count).times.and_return(attr_name.to_s)
|
||||
render
|
||||
expect(rendered).to have_text(attr_name.to_s, count: lang_count)
|
||||
end
|
||||
end
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrant/_registrant.en.html.erb' do
|
||||
include_examples 'domain mailer registrant info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrant/_registrant.en.text.erb' do
|
||||
include_examples 'domain mailer registrant info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrant/_registrant.et.html.erb' do
|
||||
include_examples 'domain mailer registrant info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrant_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrant/_registrant.et.text.erb' do
|
||||
include_examples 'domain mailer registrant info'
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/_registrant.et.text.erb' do
|
||||
RSpec.shared_examples 'domain mailer registrant info' do
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
|
||||
before :example do
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.en.html.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.en.text.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.et.html.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.et.text.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.ru.html.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -0,0 +1,6 @@
|
|||
require 'rails_helper'
|
||||
require_relative 'registrar_shared'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/registrar/_registrar.ru.text.erb' do
|
||||
include_examples 'domain mailer registrar info'
|
||||
end
|
|
@ -1,6 +1,6 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'mailers/domain_mailer/_registrar.et.text.erb' do
|
||||
RSpec.shared_examples 'domain mailer registrar info' do
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
|
||||
before :example do
|
Loading…
Add table
Add a link
Reference in a new issue