mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
parent
7e11c3a3dd
commit
eac7690345
6 changed files with 41 additions and 35 deletions
|
@ -1,11 +1,15 @@
|
||||||
class RegistrantPresenter
|
class RegistrantPresenter
|
||||||
delegate :name, :ident, :email, :priv?, to: :registrant
|
delegate :name, :ident, :email, :priv?, :street, :city, to: :registrant
|
||||||
|
|
||||||
def initialize(registrant:, view:)
|
def initialize(registrant:, view:)
|
||||||
@registrant = registrant
|
@registrant = registrant
|
||||||
@view = view
|
@view = view
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def country
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
attr_reader :registrant
|
attr_reader :registrant
|
||||||
|
|
|
@ -19,7 +19,7 @@ Nimi: <%= @registrant.name %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
Tänav: <%= @registrant.street %><br>
|
Tänav: <%= @registrant.street %><br>
|
||||||
Linn: <%= @registrant.city %><br>
|
Linn: <%= @registrant.city %><br>
|
||||||
Riik: <%= @params[:registrant_country] %>
|
Riik: <%= @registrant.country %>
|
||||||
<br><br>
|
<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.
|
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>
|
<br><br>
|
||||||
|
@ -46,14 +46,14 @@ Application for changing registrant of your domain <%= @domain.name %> has been
|
||||||
<br><br>
|
<br><br>
|
||||||
New registrant:<br>
|
New registrant:<br>
|
||||||
Name: <%= @registrant.name %><br>
|
Name: <%= @registrant.name %><br>
|
||||||
<% if @params[:registrant_priv] %>
|
<% if @registrant.priv? %>
|
||||||
Personal code: <%= @registrant.ident %><br>
|
Personal code: <%= @registrant.ident %><br>
|
||||||
<% else %>
|
<% else %>
|
||||||
Business Registry code: <%= @registrant.ident %><br>
|
Business Registry code: <%= @registrant.ident %><br>
|
||||||
<% end %>
|
<% end %>
|
||||||
Street: <%= @params[:registrant_street] %><br>
|
Street: <%= @registrant.street %><br>
|
||||||
City: <%= @params[:registrant_city] %><br>
|
City: <%= @registrant.city %><br>
|
||||||
Country: <%= @params[:registrant_country] %>
|
Country: <%= @registrant.country %>
|
||||||
<br><br>
|
<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.
|
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>
|
<br><br>
|
||||||
|
|
|
@ -16,7 +16,7 @@ Nimi: <%= @registrant.name %>
|
||||||
<% end %>
|
<% end %>
|
||||||
Tänav: <%= @registrant.street %>
|
Tänav: <%= @registrant.street %>
|
||||||
Linn: <%= @registrant.city %>
|
Linn: <%= @registrant.city %>
|
||||||
Riik: <%= @params[:registrant_country] %>
|
Riik: <%= @registrant.country %>
|
||||||
|
|
||||||
Taotlus on aktiivne <%= Setting.expire_pending_confirmation %> tundi ja lükatakse automaatselt tagasi kui te seda enne ei kinnita või tagasi lükka.
|
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:
|
Muudatuse kinnitamiseks külastage palun allolevat lehekülge, kontrollige uuesti üle muudatuse andmed ning vajutage nuppu kinnitan:
|
||||||
|
@ -38,14 +38,14 @@ Website: <%= @registrar.url %>
|
||||||
|
|
||||||
New registrant:
|
New registrant:
|
||||||
Name: <%= @registrant.name %>
|
Name: <%= @registrant.name %>
|
||||||
<% if @params[:registrant_priv] %>
|
<% if @registrant.priv? %>
|
||||||
Personal code: <%= @registrant.ident %>
|
Personal code: <%= @registrant.ident %>
|
||||||
<% else %>
|
<% else %>
|
||||||
Business Registry code: <%= @registrant.ident %>
|
Business Registry code: <%= @registrant.ident %>
|
||||||
<% end %>
|
<% end %>
|
||||||
Street: <%= @params[:registrant_street] %>
|
Street: <%= @registrant.street %>
|
||||||
City: <%= @params[:registrant_city] %>
|
City: <%= @registrant.city %>
|
||||||
Country: <%= @params[:registrant_country] %>
|
Country: <%= @registrant.country %>
|
||||||
|
|
||||||
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.
|
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:
|
To confirm the update please visit this website, once again review the data and press approve:
|
||||||
|
|
|
@ -4,31 +4,27 @@ RSpec.describe RegistrantPresenter do
|
||||||
let(:registrant) { instance_double(Registrant) }
|
let(:registrant) { instance_double(Registrant) }
|
||||||
let(:presenter) { described_class.new(registrant: registrant, view: view) }
|
let(:presenter) { described_class.new(registrant: registrant, view: view) }
|
||||||
|
|
||||||
describe '#name' do
|
registrant_delegate_attributes = %i(
|
||||||
it 'returns name' do
|
name
|
||||||
expect(registrant).to receive(:name).and_return('test name')
|
ident
|
||||||
expect(presenter.name).to eq('test name')
|
email
|
||||||
|
priv?
|
||||||
|
street
|
||||||
|
city
|
||||||
|
)
|
||||||
|
|
||||||
|
registrant_delegate_attributes.each do |attribute_name|
|
||||||
|
describe "##{attribute_name}" do
|
||||||
|
it 'delegetes to registrant' do
|
||||||
|
expect(registrant).to receive(attribute_name).and_return('test')
|
||||||
|
expect(presenter.send(attribute_name)).to eq('test')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#ident' do
|
describe '#country' do
|
||||||
it 'returns ident' do
|
it 'returns country name' do
|
||||||
expect(registrant).to receive(:ident).and_return('test ident')
|
expect(presenter.country).to be_nil
|
||||||
expect(presenter.ident).to eq('test ident')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#email' do
|
|
||||||
it 'returns email' do
|
|
||||||
expect(registrant).to receive(:email).and_return('test email')
|
|
||||||
expect(presenter.email).to eq('test email')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
describe '#priv?' do
|
|
||||||
it 'delegates to registrant' do
|
|
||||||
expect(registrant).to receive(:priv?).and_return('test')
|
|
||||||
expect(presenter.priv?).to eq('test')
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -49,6 +49,9 @@ RSpec.describe 'mailers/domain_mailer/pending_update_request_for_old_registrant.
|
||||||
registrant_attributes = %i(
|
registrant_attributes = %i(
|
||||||
name
|
name
|
||||||
ident
|
ident
|
||||||
|
street
|
||||||
|
city
|
||||||
|
country
|
||||||
)
|
)
|
||||||
|
|
||||||
registrant_attributes.each do |attr_name|
|
registrant_attributes.each do |attr_name|
|
||||||
|
|
|
@ -49,6 +49,9 @@ RSpec.describe 'mailers/domain_mailer/pending_update_request_for_old_registrant.
|
||||||
registrant_attributes = %i(
|
registrant_attributes = %i(
|
||||||
name
|
name
|
||||||
ident
|
ident
|
||||||
|
street
|
||||||
|
city
|
||||||
|
country
|
||||||
)
|
)
|
||||||
|
|
||||||
registrant_attributes.each do |attr_name|
|
registrant_attributes.each do |attr_name|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue