You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'about/_contact.html.haml' do
  4. describe 'the contact account' do
  5. it 'shows info when account is present' do
  6. account = Account.new(username: 'admin')
  7. contact = double(contact_account: account, site_contact_email: '')
  8. render 'about/contact', contact: contact
  9. expect(rendered).to have_content('@admin')
  10. end
  11. it 'does not show info when account is missing' do
  12. contact = double(contact_account: nil, site_contact_email: '')
  13. render 'about/contact', contact: contact
  14. expect(rendered).not_to have_content('@')
  15. end
  16. end
  17. describe 'the contact email' do
  18. it 'show info when email is present' do
  19. contact = double(site_contact_email: 'admin@example.com', contact_account: nil)
  20. render 'about/contact', contact: contact
  21. expect(rendered).to have_content('admin@example.com')
  22. end
  23. it 'does not show info when email is missing' do
  24. contact = double(site_contact_email: nil, contact_account: nil)
  25. render 'about/contact', contact: contact
  26. expect(rendered).not_to have_content(I18n.t('about.business_email'))
  27. end
  28. end
  29. end