I was using thoughtbot’s paperclip to attach files. I realised that paperclip only provide shoulda macros for test::unit. No cucumber macros? In the end, I got to write it. Its very simple.
The feature is shown here:
Define your steps:
As celerity does not have an attach_file method, I got to write my own. You could see it’s not hard at all. Remember to define the browser variable.
Last, we have some hooks to clean up the test upload files. Remember to place an @upload tag in your scenario.
Tags: cucumber, Rails, Software, testing