mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 00:12:03 +02:00
parent
eada1a66dd
commit
8a831ee92c
30 changed files with 205 additions and 201 deletions
35
spec/views/mailers/domain_delete_mailer/confirm_shared.rb
Normal file
35
spec/views/mailers/domain_delete_mailer/confirm_shared.rb
Normal file
|
@ -0,0 +1,35 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.shared_examples 'domain delete mailer confirm' do
|
||||
let(:domain) { instance_spy(DomainPresenter) }
|
||||
let(:lang_count) { 2 }
|
||||
|
||||
before :example do
|
||||
assign(:domain, domain)
|
||||
assign(:registrar, nil)
|
||||
assign(:confirm_url, 'test confirm 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 confirm url' do
|
||||
mention_count = 1 * lang_count
|
||||
render
|
||||
expect(rendered).to have_text('test confirm url', count: mention_count)
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue