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

This commit is contained in:
KMY 2024-12-31 11:56:36 +09:00
commit 3c77d4e8e4
268 changed files with 4213 additions and 3029 deletions

View file

@ -262,16 +262,22 @@ RSpec.describe ActivityPub::ProcessStatusUpdateService do
updated: '2021-09-08T22:39:25Z',
tag: [
{ type: 'Hashtag', name: 'foo' },
{ type: 'Hashtag', name: 'bar' },
],
}
end
before do
subject.call(status, json, json)
status.account.featured_tags.create!(name: 'bar')
status.account.featured_tags.create!(name: 'test')
end
it 'updates tags' do
expect(status.tags.reload.map(&:name)).to eq %w(foo)
it 'updates tags and featured tags' do
expect { subject.call(status, json, json) }
.to change { status.tags.reload.pluck(:name) }.from(%w(test foo)).to(%w(foo bar))
.and change { status.account.featured_tags.find_by(name: 'test').statuses_count }.by(-1)
.and change { status.account.featured_tags.find_by(name: 'bar').statuses_count }.by(1)
.and change { status.account.featured_tags.find_by(name: 'bar').last_status_at }.from(nil).to(be_within(0.1).of(Time.now.utc))
end
end