0
0
Fork 0

Fix media attachments without file being uploadable (#12562)

Fix #12554
This commit is contained in:
Eugen Rochko 2020-01-23 21:40:03 +01:00 committed by GitHub
parent 43daeccccb
commit 81cc86bb1f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 21 deletions

View file

@ -1,16 +1,12 @@
Fabricator(:media_attachment) do
account
file do |attrs|
[
case attrs[:type]
when :gifv
attachment_fixture ['attachment.gif', 'attachment.webm'].sample
when :image
attachment_fixture 'attachment.jpg'
when nil
attachment_fixture ['attachment.gif', 'attachment.jpg', 'attachment.webm'].sample
end,
nil
].sample
case attrs[:type]
when :gifv, :video
attachment_fixture('attachment.webm')
else
attachment_fixture('attachment.jpg')
end
end
end