mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-20 03:25:17 +01:00
Add test coverage for POST /api/v2/media's max description length (#32683)
This commit is contained in:
parent
b107fc2e65
commit
d94a367aeb
@ -29,6 +29,22 @@ RSpec.describe 'Media API', :attachment_processing do
|
||||
end
|
||||
end
|
||||
|
||||
context 'when media description is too long' do
|
||||
let(:params) do
|
||||
{
|
||||
file: fixture_file_upload('attachment-jpg.123456_abcd', 'image/jpeg'),
|
||||
description: 'aa' * MediaAttachment::MAX_DESCRIPTION_LENGTH,
|
||||
}
|
||||
end
|
||||
|
||||
it 'returns http error' do
|
||||
post '/api/v2/media', headers: headers, params: params
|
||||
|
||||
expect(response).to have_http_status(422)
|
||||
expect(response.body).to include 'Description is too long'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when large format media attachment has not been processed' do
|
||||
let(:params) { { file: fixture_file_upload('attachment.webm', 'video/webm') } }
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user