0
0
Fork 0

Remove Atom feeds and old URLs in the form of GET /:username/updates/:id (#11247)

This commit is contained in:
Eugen Rochko 2019-07-07 16:16:51 +02:00 committed by GitHub
parent 406b46395d
commit b851456139
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 130 additions and 2791 deletions

View file

@ -143,12 +143,6 @@ RSpec.describe ActivityPub::TagManager do
expect(subject.uri_to_resource(OStatus::TagManager.instance.uri_for(status), Status)).to eq status
end
it 'returns the local status for OStatus StreamEntry URL' do
status = Fabricate(:status)
stream_entry_url = account_stream_entry_url(status.account, status.stream_entry)
expect(subject.uri_to_resource(stream_entry_url, Status)).to eq status
end
it 'returns the remote status by matching URI without fragment part' do
status = Fabricate(:status, uri: 'https://example.com/123')
expect(subject.uri_to_resource('https://example.com/123#456', Status)).to eq status

File diff suppressed because it is too large Load diff

View file

@ -25,15 +25,6 @@ describe StatusFinder do
end
end
context 'with a stream entry url' do
let(:stream_entry) { Fabricate(:stream_entry) }
let(:url) { account_stream_entry_url(stream_entry.account, stream_entry) }
it 'finds the stream entry' do
expect(subject.status).to eq(stream_entry.status)
end
end
context 'with a remote url even if id exists on local' do
let(:status) { Fabricate(:status) }
let(:url) { "https://example.com/users/test/statuses/#{status.id}" }

View file

@ -119,46 +119,4 @@ RSpec.describe TagManager do
expect(TagManager.instance.same_acct?('username', 'incorrect@Cb6E6126.nGrOk.Io')).to eq false
end
end
describe '#url_for' do
let(:alice) { Fabricate(:account, username: 'alice') }
subject { TagManager.instance.url_for(target) }
context 'activity object' do
let(:target) { Fabricate(:status, account: alice, reblog: Fabricate(:status)).stream_entry }
it 'returns the unique tag for status' do
expect(target.object_type).to eq :activity
is_expected.to eq "https://cb6e6126.ngrok.io/@alice/#{target.id}"
end
end
context 'comment object' do
let(:target) { Fabricate(:status, account: alice, reply: true) }
it 'returns the unique tag for status' do
expect(target.object_type).to eq :comment
is_expected.to eq "https://cb6e6126.ngrok.io/@alice/#{target.id}"
end
end
context 'note object' do
let(:target) { Fabricate(:status, account: alice, reply: false, thread: nil) }
it 'returns the unique tag for status' do
expect(target.object_type).to eq :note
is_expected.to eq "https://cb6e6126.ngrok.io/@alice/#{target.id}"
end
end
context 'person object' do
let(:target) { alice }
it 'returns the URL for account' do
expect(target.object_type).to eq :person
is_expected.to eq 'https://cb6e6126.ngrok.io/@alice'
end
end
end
end