File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ def uri_for(target)
5050 context_url ( target ) unless target . parent_account_id . nil? || target . parent_status_id . nil?
5151 when :note , :comment , :activity
5252 if target . account . numeric_ap_id?
53- return activity_ap_account_status_url ( target . account , target ) if target . reblog?
53+ return activity_ap_account_status_url ( target . account . id , target ) if target . reblog?
5454
5555 ap_account_status_url ( target . account . id , target )
5656 else
Original file line number Diff line number Diff line change 128128 . to eq ( "#{ host_prefix } /ap/users/#{ status . account . id } /statuses/#{ status . id } " )
129129 end
130130 end
131+
132+ context 'with a reblog' do
133+ let ( :status ) { Fabricate ( :status , account :, reblog : Fabricate ( :status ) ) }
134+
135+ context 'when using a numeric ID based scheme' do
136+ let ( :account ) { Fabricate ( :account , id_scheme : :numeric_ap_id ) }
137+
138+ it 'returns a string starting with web domain and with the expected path' do
139+ expect ( subject . uri_for ( status ) )
140+ . to eq ( "#{ host_prefix } /ap/users/#{ status . account . id } /statuses/#{ status . id } /activity" )
141+ end
142+ end
143+
144+ context 'when using the legacy username based scheme' do
145+ let ( :account ) { Fabricate ( :account , id_scheme : :username_ap_id ) }
146+
147+ it 'returns a string starting with web domain and with the expected path' do
148+ expect ( subject . uri_for ( status ) )
149+ . to eq ( "#{ host_prefix } /users/#{ status . account . username } /statuses/#{ status . id } /activity" )
150+ end
151+ end
152+ end
131153 end
132154
133155 context 'with a remote status' do
You can’t perform that action at this time.
0 commit comments