I have seen lots on simulating uploads with Functional and Unit tests,
but all efforts I have made so far do not encode the files as multipart
form-data so they end up as a string.
I suspect I need to encode my post but don't see how this can be done
in the API.
Any pointers would be greatly appreciated!
that doesn't help with integration testing, because the TestUploadedFile
instance gets transformed into a string, yielding a
NoMethodError (undefined method `content_type' for
"#<ActionController::TestUploadedFile:0xa6ff4848>":String)
in the controller expecting an uploaded file.
Jens
> On 12/3/06, supagroova <supag...@gmail.com> wrote:
> >
> >
> > Does anybody know how to upload files in RoR Integration Tests?
> >
> > I have seen lots on simulating uploads with Functional and Unit tests,
> > but all efforts I have made so far do not encode the files as multipart
> > form-data so they end up as a string.
> >
> > I suspect I need to encode my post but don't see how this can be done
> > in the API.
> >
> > Any pointers would be greatly appreciated!
> >
> >
> > >
> >
>
>
>
--
Jens Krämer
j...@jkraemer.net
I just built a small plugin for this - have a look at it there:
http://www.jkraemer.net/2006/12/13/integration-test-your-file-uploads
Jens
--
Jens Krämer
j...@jkraemer.net