mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 01:11:43 +02:00
parent
962e98317d
commit
a6de3761c5
57 changed files with 238 additions and 203 deletions
|
@ -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
|
25
spec/views/mailers/shared/registrant/registrant_shared.rb
Normal file
25
spec/views/mailers/shared/registrant/registrant_shared.rb
Normal file
|
@ -0,0 +1,25 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer registrant info' do
|
||||
let(:registrant) { instance_spy(RegistrantPresenter) }
|
||||
|
||||
before :example do
|
||||
allow(view).to receive(:registrant).and_return(registrant)
|
||||
end
|
||||
|
||||
attributes = %i(
|
||||
name
|
||||
ident
|
||||
street
|
||||
city
|
||||
country
|
||||
)
|
||||
|
||||
attributes.each do |attr_name|
|
||||
it "has #{attr_name}" do
|
||||
expect(registrant).to receive(attr_name).and_return("test #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test #{attr_name}")
|
||||
end
|
||||
end
|
||||
end
|
|
@ -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
|
24
spec/views/mailers/shared/registrar/registrar_shared.rb
Normal file
24
spec/views/mailers/shared/registrar/registrar_shared.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain mailer registrar info' do
|
||||
let(:registrar) { instance_spy(RegistrarPresenter) }
|
||||
|
||||
before :example do
|
||||
allow(view).to receive(:registrar).and_return(registrar)
|
||||
end
|
||||
|
||||
attributes = %i(
|
||||
name
|
||||
email
|
||||
phone
|
||||
url
|
||||
)
|
||||
|
||||
attributes.each do |attr_name|
|
||||
it "has #{attr_name}" do
|
||||
expect(registrar).to receive(attr_name).and_return("test #{attr_name}")
|
||||
render
|
||||
expect(rendered).to have_text("test #{attr_name}")
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue