Fix media attachments without file being uploadable (#12562)
Fix #12554
This commit is contained in:
parent
43daeccccb
commit
81cc86bb1f
4 changed files with 19 additions and 21 deletions
|
@ -31,14 +31,6 @@ RSpec.describe MediaAttachment, type: :model do
|
|||
context 'file is blank' do
|
||||
let(:file) { nil }
|
||||
|
||||
context 'remote_url is blank' do
|
||||
let(:remote_url) { '' }
|
||||
|
||||
it 'returns false' do
|
||||
is_expected.to be false
|
||||
end
|
||||
end
|
||||
|
||||
context 'remote_url is present' do
|
||||
let(:remote_url) { 'remote_url' }
|
||||
|
||||
|
@ -153,6 +145,11 @@ RSpec.describe MediaAttachment, type: :model do
|
|||
end
|
||||
end
|
||||
|
||||
it 'is invalid without file' do
|
||||
media = MediaAttachment.new(account: Fabricate(:account))
|
||||
expect(media.valid?).to be false
|
||||
end
|
||||
|
||||
describe 'descriptions for remote attachments' do
|
||||
it 'are cut off at 1500 characters' do
|
||||
media = Fabricate(:media_attachment, description: 'foo' * 1000, remote_url: 'http://example.com/blah.jpg')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue