logo

mastofe

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

show.html.haml_spec.rb (1454B)


  1. # frozen_string_literal: true
  2. require 'rails_helper'
  3. describe 'about/show.html.haml', without_verify_partial_doubles: true do
  4. before do
  5. allow(view).to receive(:site_hostname).and_return('example.com')
  6. allow(view).to receive(:site_title).and_return('example site')
  7. end
  8. it 'has valid open graph tags' do
  9. instance_presenter = double(:instance_presenter,
  10. site_title: 'something',
  11. site_description: 'something',
  12. version_number: '1.0',
  13. source_url: 'https://github.com/tootsuite/mastodon',
  14. open_registrations: false,
  15. thumbnail: nil,
  16. hero: nil,
  17. user_count: 0,
  18. status_count: 0,
  19. contact_account: nil,
  20. closed_registrations_message: 'yes')
  21. assign(:instance_presenter, instance_presenter)
  22. render
  23. header_tags = view.content_for(:header_tags)
  24. expect(header_tags).to match(%r{<meta content=".+" property="og:title" />})
  25. expect(header_tags).to match(%r{<meta content="website" property="og:type" />})
  26. expect(header_tags).to match(%r{<meta content=".+" property="og:image" />})
  27. expect(header_tags).to match(%r{<meta content="http://.+" property="og:url" />})
  28. end
  29. end