2016-03-29 06:12:57 -04:00
|
|
|
FactoryGirl.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-01-24 20:30:56 -05:00
|
|
|
project factory: :empty_project
|
2016-03-29 06:12:57 -04:00
|
|
|
secret nil
|
|
|
|
|
|
|
|
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
|