Merge remote-tracking branch 'parent/main' into upstream-20241206
This commit is contained in:
commit
3c3ee557d0
187 changed files with 1105 additions and 537 deletions
|
@ -7,10 +7,12 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
|||
|
||||
let(:thread) { nil }
|
||||
let!(:status) { Fabricate(:status, text: 'Hello world', account: Fabricate(:account, domain: 'example.com'), thread: thread) }
|
||||
let(:bogus_mention) { 'https://example.com/users/erroringuser' }
|
||||
let(:json_tags) do
|
||||
[
|
||||
{ type: 'Hashtag', name: 'hoge' },
|
||||
{ type: 'Mention', href: ActivityPub::TagManager.instance.uri_for(alice) },
|
||||
{ type: 'Mention', href: bogus_mention },
|
||||
]
|
||||
end
|
||||
let(:content) { 'Hello universe' }
|
||||
|
@ -39,16 +41,18 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
|
|||
mentions.each { |a| Fabricate(:mention, status: status, account: a) }
|
||||
tags.each { |t| status.tags << t }
|
||||
media_attachments.each { |m| status.media_attachments << m }
|
||||
stub_request(:get, bogus_mention).to_raise(HTTP::ConnectionError)
|
||||
end
|
||||
|
||||
describe '#call' do
|
||||
it 'updates text and content warning' do
|
||||
it 'updates text and content warning, and schedules re-fetching broken mention' do
|
||||
subject.call(status, json, json)
|
||||
expect(status.reload)
|
||||
.to have_attributes(
|
||||
text: eq('Hello universe'),
|
||||
spoiler_text: eq('Show more')
|
||||
)
|
||||
expect(MentionResolveWorker).to have_enqueued_sidekiq_job(status.id, bogus_mention, anything)
|
||||
end
|
||||
|
||||
context 'when the changes are only in sanitized-out HTML' do
|
||||
|
|
|
@ -70,7 +70,7 @@ RSpec.describe PostStatusService do
|
|||
subject.call(account, text: 'Hi future!', scheduled_at: invalid_scheduled_time)
|
||||
end.to raise_error(
|
||||
ActiveRecord::RecordInvalid,
|
||||
'Validation failed: Scheduled at The scheduled date must be in the future'
|
||||
'Validation failed: Scheduled at date must be in the future'
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue