static public Method

TestUploadedFile.new(path, content_type = Mime::TEXT, binary = false)

There's no documentation for this item.

Source Code

# File action_controller/test_process.rb, line 339
def initialize(path, content_type = Mime::TEXT, binary = false)
  raise "#{path} file does not exist" unless File.exist?(path)
  @content_type = content_type
  @original_filename = path.sub(/^.*#{File::SEPARATOR}([^#{File::SEPARATOR}]+)$/) { $1 }
  @tempfile = Tempfile.new(@original_filename)
  @tempfile.binmode if binary
  FileUtils.copy_file(path, @tempfile.path)
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.