1
0
mirror of https://framagit.org/tykayn/mastodon.git synced 2023-08-25 08:33:12 +02:00
mastodon/spec/fabricators/media_attachment_fabricator.rb
Akihiko Odaki (@fn_aki@pawoo.net) 356df7ae6b Update fabricator for MediaAttachment to attach a file according to type ()
This fixes a random spec failures since commit
d55f207274.
2017-06-20 20:40:45 +02:00

17 lines
391 B
Ruby

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