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: direct_upload_test.rb
    path of file: ./repos/workarea/core/test/services/workarea
    
    the code of the file until where you have to start completion: require 'test_helper'

module Workarea
  class DirectUploadTest < TestCase
    def test_asserting_type
      assert_raises { Dir
    
    def test_validation
      direct_upload = DirectUpload.new(:product_image, 'foo.0.jpg')
      refute(direct_upload.valid?)

      create_product(id: 'foo')
      assert(direct_upload.valid?)

      direct_upload = DirectUpload.new(:product_image, 'foo.0.bar.jpg')
      assert(direct_upload.valid?)

      direct_upload = DirectUpload.new(:product_image, 'foo.jpg')
      refute(direct_upload.valid?)

      direct_upload = DirectUpload.new(:product_image, 'bar.0.jpg')
      refute(direct_upload.valid?)
    end