Merge remote-tracking branch 'parent/main' into upstream-20241206

This commit is contained in:
KMY 2024-12-06 12:17:45 +09:00
commit 3c3ee557d0
187 changed files with 1105 additions and 537 deletions

View file

@ -55,6 +55,9 @@ RSpec.describe 'Instances' do
max_characters: StatusLengthValidator::MAX_CHARS,
max_media_attachments: Status::MEDIA_ATTACHMENTS_LIMIT
),
media_attachments: include(
description_limit: MediaAttachment::MAX_DESCRIPTION_LENGTH
),
polls: include(
max_options: PollValidator::MAX_OPTIONS
)

View file

@ -7,6 +7,29 @@ RSpec.describe 'Tags' do
context 'when tag exists' do
let(:tag) { Fabricate :tag }
context 'with HTML format' do
before { get tag_path(tag) }
it 'returns page with links to alternate resources' do
expect(rss_links.first[:href])
.to eq(tag_url(tag))
expect(activity_json_links.first[:href])
.to eq(tag_url(tag))
end
def rss_links
alternate_links.css('[type="application/rss+xml"]')
end
def activity_json_links
alternate_links.css('[type="application/activity+json"]')
end
def alternate_links
response.parsed_body.css('link[rel=alternate]')
end
end
context 'with JSON format' do
before { get tag_path(tag, format: :json) }