mirror of
https://github.com/internetee/registry.git
synced 2025-08-12 12:39:34 +02:00
parent
6ab18da7b3
commit
b953b1d46d
3 changed files with 0 additions and 77 deletions
|
@ -1,12 +0,0 @@
|
||||||
require 'rails_helper'
|
|
||||||
require_relative 'expiration_shared'
|
|
||||||
|
|
||||||
RSpec.describe 'mailers/domain_mailer/expiration.html.erb' do
|
|
||||||
before :example do
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.et.html' => 'test registrar estonian'
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.en.html' => 'test registrar english'
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.ru.html' => 'test registrar russian'
|
|
||||||
end
|
|
||||||
|
|
||||||
include_examples 'domain mailer expiration'
|
|
||||||
end
|
|
|
@ -1,12 +0,0 @@
|
||||||
require 'rails_helper'
|
|
||||||
require_relative 'expiration_shared'
|
|
||||||
|
|
||||||
RSpec.describe 'mailers/domain_mailer/expiration.text.erb' do
|
|
||||||
before :example do
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.et.text' => 'test registrar estonian'
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.en.text' => 'test registrar english'
|
|
||||||
stub_template 'mailers/shared/registrar/_registrar.ru.text' => 'test registrar russian'
|
|
||||||
end
|
|
||||||
|
|
||||||
include_examples 'domain mailer expiration'
|
|
||||||
end
|
|
|
@ -1,53 +0,0 @@
|
||||||
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
|
|
Loading…
Add table
Add a link
Reference in a new issue