Skip to content
Snippets Groups Projects
Commit 356df7ae authored by Akihiko Odaki (@fn_aki@pawoo.net)'s avatar Akihiko Odaki (@fn_aki@pawoo.net) Committed by Eugen Rochko
Browse files

Update fabricator for MediaAttachment to attach a file according to type (#3862)

This fixes a random spec failures since commit
d55f2072.
parent 8f03fdce
No related branches found
No related tags found
No related merge requests found
Fabricator(:media_attachment) do
account
file { [attachment_fixture(['attachment.gif', 'attachment.jpg', 'attachment.webm'].sample), nil].sample }
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment