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

This commit is contained in:
KMY 2024-06-18 07:43:33 +09:00
commit aa2cdc898a
271 changed files with 1839 additions and 1397 deletions

View file

@ -54,7 +54,7 @@ RSpec.describe ActivityPub::Activity::Flag do
}.with_indifferent_access, sender)
end
let(:long_comment) { Faker::Lorem.characters(number: 6000) }
let(:long_comment) { 'a' * described_class::COMMENT_SIZE_LIMIT * 2 }
before do
subject.perform
@ -63,10 +63,12 @@ RSpec.describe ActivityPub::Activity::Flag do
it 'creates a report but with a truncated comment' do
report = Report.find_by(account: sender, target_account: flagged)
expect(report).to_not be_nil
expect(report.comment.length).to eq 5000
expect(report.comment).to eq long_comment[0...5000]
expect(report.status_ids).to eq [status.id]
expect(report)
.to be_present
.and have_attributes(status_ids: [status.id])
expect(report.comment)
.to have_attributes(length: described_class::COMMENT_SIZE_LIMIT)
.and eq(long_comment[0...described_class::COMMENT_SIZE_LIMIT])
end
end

View file

@ -325,7 +325,7 @@ RSpec.describe ActivityPub::Activity::Like do
Fabricate(:custom_emoji, domain: nil, shortcode: 'tinking', license: 'Everyone but Ohagi')
end
it 'create emoji reaction' do # rubocop:disable RSpec/MultipleExpectations
it 'create emoji reaction' do
expect(subject.count).to eq 1
expect(subject.first.name).to eq 'tinking'
expect(subject.first.account).to eq sender

View file

@ -243,13 +243,13 @@ RSpec.describe FeedManager do
expect(described_class.instance.filter?(:mentions, reply, bob)).to be true
end
it 'returns true for status by silenced account who recipient is not following' do
it 'returns false for status by limited account who recipient is not following' do
status = Fabricate(:status, text: 'Hello world', account: alice)
alice.silence!
expect(described_class.instance.filter?(:mentions, status, bob)).to be true
expect(described_class.instance.filter?(:mentions, status, bob)).to be false
end
it 'returns false for status by followed silenced account' do
it 'returns false for status by followed limited account' do
status = Fabricate(:status, text: 'Hello world', account: alice)
alice.silence!
bob.follow!(alice)