Files
mastodon/spec/views/statuses/show.html.haml_spec.rb
Claire 0d69cc068c Merge commit '26f25ef4bafd5ad84d03d8cb7ad0d868360175e5' into glitch-soc/stable-4.3
Conflicts:
- `app/javascript/styles/mastodon/components.scss`:
  Conflict caused by glitch-soc changing the path to images, and upstream
  removing styling using such an image.
  Removed the styling as upstream did.
- `app/models/trends/statuses.rb`:
  Upstream added a date restriction to trendable posts, while glitch-soc had
  slightly different conditions.
  Added the date restriction to glitch-soc's conditions.
2024-12-02 21:49:12 +01:00

54 lines
1.5 KiB
Ruby

# frozen_string_literal: true
require 'rails_helper'
RSpec.describe 'statuses/show.html.haml' do
let(:alice) { Fabricate(:account, username: 'alice', display_name: 'Alice') }
let(:status) { Fabricate(:status, account: alice, text: 'Hello World') }
before do
view.extend view_helpers
assign(:instance_presenter, InstancePresenter.new)
Fabricate(:media_attachment, account: alice, status: status, type: :video)
assign(:status, status)
assign(:account, alice)
assign(:descendant_threads, [])
end
it 'has valid opengraph tags and twitter player tags' do
render
expect(header_tags)
.to match(/<meta content=".+" property="og:title">/)
.and match(/<meta content="article" property="og:type">/)
.and match(/<meta content=".+" property="og:image">/)
.and match(%r{<meta content="http://.+" property="og:url">})
expect(header_tags)
.to match(%r{<meta content="http://.+/media/.+/player" property="twitter:player">})
.and match(/<meta content="player" property="twitter:card">/)
end
def header_tags
view.content_for(:header_tags)
end
def view_helpers
Module.new do
def api_oembed_url(_) = ''
def show_landing_strip? = true
def site_title = 'example site'
def site_hostname = 'example.com'
def full_asset_url(_) = '//asset.host/image.svg'
def current_account = nil
def current_flavour = 'glitch'
def single_user_mode? = false
def local_time = nil
def local_time_ago = nil
end
end
end