2019-10-12 21:52:04 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2018-03-17 18:26:18 +05:30
|
|
|
FactoryBot.define do
|
2016-06-02 11:05:42 +05:30
|
|
|
factory :file_uploader do
|
2017-09-10 17:25:29 +05:30
|
|
|
skip_create
|
|
|
|
|
|
|
|
project
|
2016-06-02 11:05:42 +05:30
|
|
|
secret nil
|
|
|
|
|
|
|
|
transient do
|
|
|
|
fixture { 'rails_sample.jpg' }
|
|
|
|
path { File.join(Rails.root, 'spec/fixtures', fixture) }
|
|
|
|
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
|