logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

_contact.html.haml_spec.rb (1061B)


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