FactoryBot.define do
  factory :task_request do
    association :project
    user_email 'test@email.com'
    deadline { 10.days.from_now }
    time_allowed 5
    description "Task request"
    additional_notes "Additional notes"
    status 0
    
    trait :completed do
      deliverable_url "example.com/deliverables"
      status 1
    end

    trait :with_files do
      files { [Rack::Test::UploadedFile.new('spec/fixtures/files/contract.pdf', 'application/pdf')] }
    end
  end
end
