discourse/spec/fabricators/upload_fabricator.rb

18 lines
412 B
Ruby
Raw Normal View History

Fabricator(:upload) do
user
sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }
2014-04-15 04:55:57 +08:00
original_filename "logo.png"
filesize 1234
width 100
height 200
url { sequence(:url) { |n| "/uploads/default/#{n}/1234567890123456.png" } }
end
2013-07-11 04:59:07 +08:00
Fabricator(:attachment, from: :upload) do
id 42
2013-07-11 04:59:07 +08:00
user
original_filename "archive.zip"
filesize 1234
url "/uploads/default/42/66b3ed1503efc936.zip"
2013-07-11 04:59:07 +08:00
end