Class Rack::Test::UploadedFile
In: lib/rack/test/uploaded_file.rb
Parent: Object

Wraps a Tempfile with a content type. Including one or more UploadedFile‘s in the params causes Rack::Test to build and issue a multipart request.

Example:

  post "/photos", "file" => Rack::Test::UploadedFile.new("me.jpg", "image/jpeg")

Methods

local_path   new   path  

Attributes

content_type  [RW]  The content type of the "uploaded" file
original_filename  [R]  The filename, not including the path, of the "uploaded" file

Public Class methods

Public Instance methods

local_path()

Alias for path

[Validate]