You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: legacy_uploads_migrator_spec.rb
    path of file: ./repos/gitlabhq/spec/lib/gitlab/background_migration
    
    the code of the file until where you have to start completion: # frozen_string_literal: true
require 'spec_helper'

# rubocop: disable RSpec/FactoriesInMigrationSpecs
RSpec.describe Gitlab::BackgroundMigration::LegacyUploadsMigrator do
  let(:test_dir) { FileUploader.options['storage_path'] }

  let!(:hashed_project) { create(:project) }
  let!(:legacy_project) { create(:project, :legacy_storage) }
  let!(:issue) { create(:issue, pr
    
  def create_upload(model, with_file = true)
    filename = 'image.png'
    params = {
      path: "uploads/-/system/note/attachment/#{model.id}/#{filename}",
      model: model,
      store: ObjectStorage::Store::LOCAL
    }

    if with_file
      upload = create(:upload, :with_file, :attachment_upload, params)
      model.update!(attachment: upload.retrieve_uploader)
      model.attachment.upload
    else
      create(:upload, :attachment_upload, params)
    end