debian-mirror-gitlab/spec/factories/file_uploader.rb
2017-08-17 22:00:37 +05:30

20 lines
436 B
Ruby

FactoryGirl.define do
factory :file_uploader do
project factory: :empty_project
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