v1.1.1 - Show latest stable - 1 note - Superclass: Object

Essentially generates a modified Tempfile object similar to the object you’d get from the standard library CGI module in a multipart request. This means you can use an ActionController::TestUploadedFile object in the params of a test request in order to simulate a file upload.

Usage example, within a functional test:

  post :change_avatar, :avatar => ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path + '/files/spongebob.png', 'image/png')


  • path
Show files where this class is defined (1 file)
Register or log in to add new notes.
February 10, 2009
2 thanks