views:

63

answers:

1

I am trying to write specs for a working file upload functionality using attachment_fu. However, the sample code given by the author for testing requires me to require action_controller/test_process so that I have access to ActionController::UploadedStringIO class. I have used this before in rails 2.x but for rails 3, it fails to locate the test_process file.

How do I go ahead with testing the file upload functionality in rails 3?

A: 

I'm working on testing file uploads in rails 3 right now, although I don't know how helpful my answer will be. Would it be possible for you to change the test? Personally, I'm using a Cucumber/Capybara approach. Capybara's DSL defines

attach_file('Image', '/path/to/image.jpg')

Personally this seems a better way to test than interacting with the StringIO object...feel free to retort.

MissingHandle