attachment_fu testing in rails 3

前端 未结 3 517
轻奢々
轻奢々 2020-12-09 11:48

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

3条回答
  •  心在旅途
    2020-12-09 12:34

    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.

提交回复
热议问题