mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-15 08:48:53 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user