Merge commit 'b06fd54c305915527e3a6edc575dc23b623143ef' into glitch-soc/merge-upstream

Conflicts:
- `app/helpers/formatting_helper.rb`:
  Upstream wrapped some code glitch-soc had modified in an OTEL instrumentation span.
  Wrapped the modified code.
This commit is contained in:
Claire
2024-11-03 20:51:58 +01:00
201 changed files with 1941 additions and 736 deletions

View File

@@ -974,6 +974,32 @@ RSpec.describe ActivityPub::Activity::Create do
expect(poll.votes.first).to be_nil
end
end
context 'with counts' do
let(:object_json) do
{
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
type: 'Note',
content: 'Lorem ipsum',
likes: {
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar', '/likes'].join,
type: 'Collection',
totalItems: 50,
},
shares: {
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar', '/shares'].join,
type: 'Collection',
totalItems: 100,
},
}
end
it 'uses the counts from the created object' do
status = sender.statuses.first
expect(status.untrusted_favourites_count).to eq 50
expect(status.untrusted_reblogs_count).to eq 100
end
end
end
context 'when object URI uses bearcaps' do