mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
parent
962e98317d
commit
a6de3761c5
57 changed files with 238 additions and 203 deletions
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
|
Loading…
Add table
Add a link
Reference in a new issue