File Uploads

Hi All.
how can i write test cases for video and image uploads.
I am using attachment_fu plugin.
Thanks
Arpit

use this:
http://api.rubyonrails.org/classes/ActionController/TestUploadedFile.html

like:
file =
ActionController::TestUploadedFile.new(Test::Unit::TestCase.fixture_path

  • ‘/files/test.gif’, ‘image/gif’)

post(:uploader, :file => get_file)

and then test if entries in your db are as expected and the file exists
in destination path

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs