|
|
|
@ -29,5 +29,20 @@ RSpec.describe PermalinkRedirector do
|
|
|
|
|
redirector = described_class.new('@alice/123')
|
|
|
|
|
expect(redirector.redirect_path).to eq 'https://example.com/status-123'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'returns path for legacy status links with a query param' do
|
|
|
|
|
redirector = described_class.new('statuses/123?foo=bar')
|
|
|
|
|
expect(redirector.redirect_path).to eq 'https://example.com/status-123'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'returns path for pretty status links with a query param' do
|
|
|
|
|
redirector = described_class.new('@alice/123?foo=bar')
|
|
|
|
|
expect(redirector.redirect_path).to eq 'https://example.com/status-123'
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
it 'returns path for deck URLs with query params' do
|
|
|
|
|
redirector = described_class.new('/deck/directory?local=true')
|
|
|
|
|
expect(redirector.redirect_path).to eq '/directory?local=true'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|