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.6 KiB

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