imedo Development Blog

there is no charge for awesomeness

File uploads with webrat in Ruby on Rails 2.0.2

without comments

Webrat supports file upload in web forms with the method attach_file. Due to a lack of multipart form support for integration tests in Action Pack 2.0.2, this does not work with Rails 2.0.2.

It has been added in version 2.1., but for those who are still using 2.0.2, with the following code you can upgrade the particular part of Action Pack to 2.1. Just add it to your tests so that it overwrites the loaded Action Pack code.

AKPC_IDS += "51702,";

Popularity: 1% [?]

Written by ehartung

September 2nd, 2009 at 1:32 pm

Posted in Testing

Tagged with , , ,

Leave a Reply