94bb660460
Using the sed script from https://gitlab.com/gitlab-org/gitlab-ce/issues/59758
24 lines
459 B
Ruby
24 lines
459 B
Ruby
# frozen_string_literal: true
|
|
|
|
FactoryBot.define do
|
|
factory :file_uploader do
|
|
skip_create
|
|
|
|
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
|