Merge branch 'master' into glitch-soc/merge-upstream
This commit is contained in:
@@ -287,6 +287,31 @@ RSpec.describe ActivityPub::Activity::Create do
|
||||
end
|
||||
end
|
||||
|
||||
context 'with media attachments with long description as summary' do
|
||||
let(:object_json) do
|
||||
{
|
||||
id: [ActivityPub::TagManager.instance.uri_for(sender), '#bar'].join,
|
||||
type: 'Note',
|
||||
content: 'Lorem ipsum',
|
||||
attachment: [
|
||||
{
|
||||
type: 'Document',
|
||||
mediaType: 'image/png',
|
||||
url: 'http://example.com/attachment.png',
|
||||
summary: '*' * 1500,
|
||||
},
|
||||
],
|
||||
}
|
||||
end
|
||||
|
||||
it 'creates status' do
|
||||
status = sender.statuses.first
|
||||
|
||||
expect(status).to_not be_nil
|
||||
expect(status.media_attachments.map(&:description)).to include('*' * 1500)
|
||||
end
|
||||
end
|
||||
|
||||
context 'with media attachments with focal points' do
|
||||
let(:object_json) do
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ describe WebfingerResource do
|
||||
|
||||
expect {
|
||||
WebfingerResource.new(resource).username
|
||||
}.to raise_error(ActiveRecord::RecordNotFound)
|
||||
}.to raise_error(WebfingerResource::InvalidRequest)
|
||||
end
|
||||
|
||||
it 'finds the username in a valid https route' do
|
||||
@@ -123,5 +123,15 @@ describe WebfingerResource do
|
||||
expect(result).to eq 'alice'
|
||||
end
|
||||
end
|
||||
|
||||
describe 'with a nonsense resource' do
|
||||
it 'raises InvalidRequest' do
|
||||
resource = 'df/:dfkj'
|
||||
|
||||
expect {
|
||||
WebfingerResource.new(resource).username
|
||||
}.to raise_error(WebfingerResource::InvalidRequest)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user