Show registrant phone in ContactMailer

#480
This commit is contained in:
Artur Beljajev 2017-05-22 12:42:10 +03:00
parent 490ebf969c
commit adcebd084a
9 changed files with 48 additions and 13 deletions

View file

@ -21,6 +21,22 @@ RSpec.shared_examples 'domain mailer registrant info' do |template_path|
expect(rendered).to have_text('test ident')
end
context 'when :with_phone is true' do
it 'has phone' do
allow(registrant).to receive(:phone).and_return('test phone')
render template: template_path, locals: { with_phone: true }
expect(rendered).to have_text('test phone')
end
end
context 'when :with_phone is false' do
it 'has no phone' do
allow(registrant).to receive(:phone).and_return('test phone')
render template: template_path, locals: { with_phone: false }
expect(rendered).to_not have_text('test phone')
end
end
address_attributes = %i[street city state zip country]
context 'when address processing is enabled' do