BigW Consortium Gitlab

file_uploader.rb 412 Bytes
Newer Older
1
FactoryGirl.define do
2
  factory :file_uploader do
3 4 5 6
    project
    secret nil

    transient do
7 8
      fixture { 'rails_sample.jpg' }
      path { File.join(Rails.root, 'spec/fixtures', fixture) }
9 10 11 12 13 14 15 16 17 18 19 20
      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