media_attachment_fabricator.rb 391 B

12345678910111213141516
  1. Fabricator(:media_attachment) do
  2. account
  3. file do |attrs|
  4. [
  5. case attrs[:type]
  6. when :gifv
  7. attachment_fixture ['attachment.gif', 'attachment.webm'].sample
  8. when :image
  9. attachment_fixture 'attachment.jpg'
  10. when nil
  11. attachment_fixture ['attachment.gif', 'attachment.jpg', 'attachment.webm'].sample
  12. end,
  13. nil
  14. ].sample
  15. end
  16. end