Impressum / Imprint

Integration test your file uploads

Posted on December 13, 2006

Surprisingly (given Rails’ generally good testing support), it is not possible to do multipart post requests in integration tests.

At least until now ;-) What is needed to allow for multipart post requests is a method that builds the correctly encoded body from the given parameters, including correct MIME boundaries and headers for the different parts. For easy reuse I put this into a small plugin.

Installation

script/plugin install svn://projects.jkraemer.net/plugins/multipart_integration_test

read on for usage notes…