Is there any way to Integration test the posting of a file as part of form? (Using Rails 2)

0 views
Skip to first unread message

Declan McGrath

unread,
Apr 17, 2008, 10:13:35 AM4/17/08
to ruby_i...@googlegroups.com
Hi folks,

I thought that this would be an easy one but turns out it isn't possible out
of the box with Rails :(

I've come across this ticket online http://dev.rubyonrails.org/ticket/4635
which seems to state (at the end of the post) that posting files within an
Integration test is not possible with Rails 2. I'm also getting this problem.

I've tried the fix at this address
http://www.jkraemer.net/2006/12/13/integration-test-your-file-uploads but to
know avail (I actually couldn't use it as a plugin so I just dumped the
contents of the plugin into my Integration Test).

Any 'elp greatly appreciated!

Happy hackin,
Dec

Declan McGrath

unread,
Apr 17, 2008, 10:35:35 AM4/17/08
to ruby_i...@googlegroups.com
Nothing like answering your own post. I have found that the
integration_test_file_upload_deep.rb patch at
http://dev.rubyonrails.org/ticket/4635 works with Rails 2.0.2 as long as you
use the method multipart_post() instead of just post()

Dec

Reply all
Reply to author
Forward
0 new messages