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
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue