gitlab-org--gitlab-foss/spec/factories/file_uploaders.rb

23 lines
453 B
Ruby
Raw Normal View History

FactoryGirl.define do
2016-03-31 03:43:47 -04:00
factory :file_uploader do
skip_create
project factory: :empty_project
secret nil
transient do
2016-03-31 03:43:47 -04:00
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