mirror of
https://github.com/yingziwu/mastodon.git
synced 2026-02-04 03:25:14 +00:00
Fix URI generation for reblogs by accounts with numerical AP ids (#37415)
This commit is contained in:
parent
adea0b7b31
commit
deeaf50472
2 changed files with 23 additions and 1 deletions
|
|
@ -128,6 +128,28 @@ RSpec.describe ActivityPub::TagManager do
|
|||
.to eq("#{host_prefix}/ap/users/#{status.account.id}/statuses/#{status.id}")
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a reblog' do
|
||||
let(:status) { Fabricate(:status, account:, reblog: Fabricate(:status)) }
|
||||
|
||||
context 'when using a numeric ID based scheme' do
|
||||
let(:account) { Fabricate(:account, id_scheme: :numeric_ap_id) }
|
||||
|
||||
it 'returns a string starting with web domain and with the expected path' do
|
||||
expect(subject.uri_for(status))
|
||||
.to eq("#{host_prefix}/ap/users/#{status.account.id}/statuses/#{status.id}/activity")
|
||||
end
|
||||
end
|
||||
|
||||
context 'when using the legacy username based scheme' do
|
||||
let(:account) { Fabricate(:account, id_scheme: :username_ap_id) }
|
||||
|
||||
it 'returns a string starting with web domain and with the expected path' do
|
||||
expect(subject.uri_for(status))
|
||||
.to eq("#{host_prefix}/users/#{status.account.username}/statuses/#{status.id}/activity")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a remote status' do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue