FactoryBot.define do
  factory :download do
    association :project
    
    release_type "AppearanceRelease"

    trait :with_file do
      file do
        path = Rails.root.join("spec", "fixtures", "files", "contract.pdf")
        Rack::Test::UploadedFile.new(path, "application/pdf")
      end
    end

    factory :download_release_type_appearance do
      name "Natgeo Contract"
      release_type "AppearanceRelease"
    end

    factory :download_release_type_music  do
      name "Discovery Contract"
      release_type "MusicRelease"
    end
  end
end
