about summary refs log tree commit diff
path: root/spec/fabricators/media_attachment_fabricator.rb
blob: bb938e36d9825d6bbd9f1769d84e04731bf9889b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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
  end
end