title: Validate for file format doesn't pass during tests
body: <p>I have model <code>ImportFile</code> and it has <code>has_one_attached :document</code> and validate for file format:
  <code>validates :document, blob: { content_type: ['application/vnd.ms-excel'] }</code> (only .xls)</p>
  <p>I created factory for this model:</p>
  <pre class="lang-rb prettyprint-override"><code>FactoryBot.define do
    factory :import_file do
      association :user
      processed { false }
      document { Rack::Test::UploadedFile.new('spec/fixtures/orders.xls') }
    end
  end
  </code></pre>
  <p>And when i run tests, they didn't pass, i got validation error:</p>
  <p><code>Validation failed: Document is not a valid file format</code></p>
  <p>But if i load this file on site it works perfectly.</p>
  <p>Why format validation doesn't pass during tests?</p>