2013-06-16 19:46:42 -05:00
|
|
|
Fabricator(:upload) do
|
|
|
|
user
|
2016-07-01 02:22:30 -05:00
|
|
|
sha1 { sequence(:sha1) { |n| Digest::SHA1.hexdigest(n.to_s) } }
|
2014-04-14 15:55:57 -05:00
|
|
|
original_filename "logo.png"
|
2013-06-16 19:46:42 -05:00
|
|
|
filesize 1234
|
|
|
|
width 100
|
|
|
|
height 200
|
2018-10-04 09:00:07 -05:00
|
|
|
thumbnail_width 30
|
|
|
|
thumbnail_height 60
|
2018-09-14 00:42:59 -05:00
|
|
|
|
|
|
|
url do |attrs|
|
|
|
|
sequence(:url) do |n|
|
|
|
|
Discourse.store.get_path_for(
|
|
|
|
"original", n + 1, attrs[:sha1], ".#{attrs[:extension]}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2017-07-03 12:08:59 -05:00
|
|
|
extension "png"
|
2013-06-16 19:46:42 -05:00
|
|
|
end
|
2013-07-10 15:59:07 -05:00
|
|
|
|
2017-05-22 11:37:01 -05:00
|
|
|
Fabricator(:upload_s3, from: :upload) do
|
2018-09-14 00:42:59 -05:00
|
|
|
url do |attrs|
|
|
|
|
sequence(:url) do |n|
|
|
|
|
File.join(
|
|
|
|
Discourse.store.absolute_base_url,
|
|
|
|
Discourse.store.get_path_for(
|
|
|
|
"original", n + 1, attrs[:sha1], ".#{attrs[:extension]}"
|
|
|
|
)
|
|
|
|
)
|
|
|
|
end
|
|
|
|
end
|
2013-07-10 15:59:07 -05:00
|
|
|
end
|