mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 17:37:17 +02:00
parent
490ebf969c
commit
adcebd084a
9 changed files with 48 additions and 13 deletions
|
@ -1,5 +1,11 @@
|
|||
class RegistrantPresenter
|
||||
delegate :name, :ident, :email, :priv?, :id_code, :reg_no,
|
||||
delegate :name,
|
||||
:ident,
|
||||
:phone,
|
||||
:email,
|
||||
:priv?,
|
||||
:id_code,
|
||||
:reg_no,
|
||||
:street, :city, :state, :zip, :country,
|
||||
:ident_country,
|
||||
to: :registrant
|
||||
|
|
|
@ -17,7 +17,7 @@ Muudatusega seotud domeenid:<br>
|
|||
<% end %>
|
||||
<br>
|
||||
Kontaktandmed:<br>
|
||||
<%= render 'mailers/shared/registrant/registrant.et.html', registrant: contact %>
|
||||
<%= render 'mailers/shared/registrant/registrant.et.html', registrant: contact, with_phone: true %>
|
||||
<br><br>
|
||||
Lugupidamisega<br>
|
||||
Eesti Interneti Sihtasutus
|
||||
|
@ -40,7 +40,7 @@ Domains affected by this update:<br>
|
|||
<% end %>
|
||||
<br>
|
||||
Contact information:<br>
|
||||
<%= render 'mailers/shared/registrant/registrant.en.html', registrant: contact %>
|
||||
<%= render 'mailers/shared/registrant/registrant.en.html', registrant: contact, with_phone: true %>
|
||||
<br><br>
|
||||
Best Regards,<br>
|
||||
Estonian Internet Foundation
|
||||
|
|
|
@ -17,7 +17,7 @@ Muudatusega seotud domeenid:
|
|||
<% end %>
|
||||
|
||||
Kontaktandmed:
|
||||
<%= render 'mailers/shared/registrant/registrant.et.text', registrant: contact %>
|
||||
<%= render 'mailers/shared/registrant/registrant.et.text', registrant: contact, with_phone: true %>
|
||||
|
||||
Lugupidamisega
|
||||
Eesti Interneti Sihtasutus
|
||||
|
@ -40,7 +40,7 @@ Domains affected by this update:
|
|||
<% end %>
|
||||
|
||||
Contact information:
|
||||
<%= render 'mailers/shared/registrant/registrant.en.text', registrant: contact %>
|
||||
<%= render 'mailers/shared/registrant/registrant.en.text', registrant: contact, with_phone: true %>
|
||||
|
||||
Best Regards,
|
||||
Estonian Internet Foundation
|
||||
|
|
|
@ -4,7 +4,10 @@ Name: <%= registrant.name %><br>
|
|||
<% else %>
|
||||
Business Registry code: <%= registrant.ident %><br>
|
||||
<% end %>
|
||||
<% if address_processing %>
|
||||
<% if local_assigns[:with_phone] -%>
|
||||
Phone: <%= registrant.phone %><br>
|
||||
<% end -%>
|
||||
<% if address_processing -%>
|
||||
Street: <%= registrant.street %><br>
|
||||
City: <%= registrant.city %><br>
|
||||
State: <%= registrant.state %><br>
|
||||
|
@ -12,4 +15,4 @@ Name: <%= registrant.name %><br>
|
|||
Country: <%= registrant.country %>
|
||||
<% else %>
|
||||
Country: <%= registrant.ident_country %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
|
|
|
@ -4,7 +4,10 @@ Name: <%= registrant.name %>
|
|||
<% else %>
|
||||
Business Registry code: <%= registrant.ident %>
|
||||
<% end %>
|
||||
<% if address_processing %>
|
||||
<% if local_assigns[:with_phone] -%>
|
||||
Phone: <%= registrant.phone %>
|
||||
<% end -%>
|
||||
<% if address_processing -%>
|
||||
Street: <%= registrant.street %>
|
||||
City: <%= registrant.city %>
|
||||
State: <%= registrant.state %>
|
||||
|
@ -12,4 +15,4 @@ Name: <%= registrant.name %>
|
|||
Country: <%= registrant.country %>
|
||||
<% else %>
|
||||
Country: <%= registrant.ident_country %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
|
|
|
@ -4,7 +4,10 @@ Nimi: <%= registrant.name %><br>
|
|||
<% else %>
|
||||
Äriregistrikood: <%= registrant.ident %><br>
|
||||
<% end %>
|
||||
<% if address_processing %>
|
||||
<% if local_assigns[:with_phone] -%>
|
||||
Telefon: <%= registrant.phone %><br>
|
||||
<% end -%>
|
||||
<% if address_processing -%>
|
||||
Tänav: <%= registrant.street %><br>
|
||||
Linn: <%= registrant.city %><br>
|
||||
Maakond: <%= registrant.state %><br>
|
||||
|
@ -12,4 +15,4 @@ Nimi: <%= registrant.name %><br>
|
|||
Riik: <%= registrant.country(locale: :et) %>
|
||||
<% else %>
|
||||
Riik: <%= registrant.ident_country(locale: :et) %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
|
|
|
@ -4,7 +4,10 @@ Nimi: <%= registrant.name %>
|
|||
<% else %>
|
||||
Äriregistrikood: <%= registrant.ident %>
|
||||
<% end %>
|
||||
<% if address_processing %>
|
||||
<% if local_assigns[:with_phone] -%>
|
||||
Telefon: <%= registrant.phone %>
|
||||
<% end -%>
|
||||
<% if address_processing -%>
|
||||
Tänav: <%= registrant.street %>
|
||||
Linn: <%= registrant.city %>
|
||||
Maakond: <%= registrant.state %>
|
||||
|
@ -12,4 +15,4 @@ Nimi: <%= registrant.name %>
|
|||
Riik: <%= registrant.country(locale: :et) %>
|
||||
<% else %>
|
||||
Riik: <%= registrant.ident_country(locale: :et) %>
|
||||
<% end %>
|
||||
<% end -%>
|
||||
|
|
|
@ -43,6 +43,7 @@ RSpec.describe RegistrantPresenter do
|
|||
registrant_delegatable_attributes = %i(
|
||||
name
|
||||
ident
|
||||
phone
|
||||
email
|
||||
priv?
|
||||
street
|
||||
|
|
|
@ -21,6 +21,22 @@ RSpec.shared_examples 'domain mailer registrant info' do |template_path|
|
|||
expect(rendered).to have_text('test ident')
|
||||
end
|
||||
|
||||
context 'when :with_phone is true' do
|
||||
it 'has phone' do
|
||||
allow(registrant).to receive(:phone).and_return('test phone')
|
||||
render template: template_path, locals: { with_phone: true }
|
||||
expect(rendered).to have_text('test phone')
|
||||
end
|
||||
end
|
||||
|
||||
context 'when :with_phone is false' do
|
||||
it 'has no phone' do
|
||||
allow(registrant).to receive(:phone).and_return('test phone')
|
||||
render template: template_path, locals: { with_phone: false }
|
||||
expect(rendered).to_not have_text('test phone')
|
||||
end
|
||||
end
|
||||
|
||||
address_attributes = %i[street city state zip country]
|
||||
|
||||
context 'when address processing is enabled' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue