2019-07-25 01:11:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-12-13 19:13:44 -05:00
|
|
|
FactoryBot.define do
|
2016-03-31 03:43:47 -04:00
|
|
|
factory :file_uploader do
|
2017-05-31 09:43:19 -04:00
|
|
|
skip_create
|
|
|
|
|
2017-08-02 15:55:11 -04:00
|
|
|
project
|
2019-10-01 20:06:26 -04:00
|
|
|
secret { nil }
|
2016-03-29 06:12:57 -04:00
|
|
|
|
|
|
|
transient do
|
2016-03-31 03:43:47 -04:00
|
|
|
fixture { 'rails_sample.jpg' }
|
|
|
|
path { File.join(Rails.root, 'spec/fixtures', fixture) }
|
2016-03-29 06:12:57 -04:00
|
|
|
file { Rack::Test::UploadedFile.new(path) }
|
|
|
|
end
|
|
|
|
|
|
|
|
after(:build) do |uploader, evaluator|
|
|
|
|
uploader.store!(evaluator.file)
|
|
|
|
end
|
|
|
|
|
|
|
|
initialize_with do
|
|
|
|
new(project, secret)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|