[rspec-users] attachment_fu and story runner, any updates
rick.denatale at gmail.com
Tue Jan 22 11:44:54 EST 2008
On Jan 21, 2008 11:36 PM, David Chelimsky <dchelimsky at gmail.com> wrote:
> On Jan 21, 2008 2:12 PM, Rick DeNatale <rick.denatale at gmail.com> wrote:
> > I'm trying to write a story for a Rails app which involves using the
> > attachment_fu plugin to upload images.
> > After blunting my pick on this for a while, google found me this:
> > http://www.ruby-forum.com/topic/134743#600831
> > So it seems that there's a hole in Rails integration testing and
> > multipart form posting. David offered to incorporate a patch to story
> > runner at the end of the reference thread in ruby-talk, although just
> > which patch confuses me, it would seem to be one from
> > http://dev.rubyonrails.org/ticket/4635
> > So what is the current status here?
> "There are no tests for the rails patch. If you're willing to add
> rspec examples and contribute it to the rspec tracker, I'll add it to
> rspec as a temporary fix until that ticket is resolved."
> I think that's where we left it.
> Probably belongs in a separate plugin though - not as part of rspec. Any takers?
After looking at the patches a bit, I decided to dig in and write a
new rails patch which will work slightly differently.
The current patch explicitly requires the use of a multi_part method.
The problem is that this doesn't work if you want to use, say
post_via_redirect, and it also doesn't handle multipart put requests,
which just might be useful in our RESTful world these days.
So instead I'm now debugging a new patch which adds the ability for an
integration controller to detect parameter values which are instances
of TestUploadedFile and automatically generate a multipart request.
In the meantime, I seem to be running into the issue discussed here:
I find I need to have this:
Test::Unit::TestCase.fixture_path = RAILS_ROOT + '/spec/fixtures/'
I thought that this was fixed?
$ svn propget piston:root vendor/plugins/rspec
$ svn propget piston:root vendor/plugins/rspec_on_rails
$ svn propget piston:remote-revision vendor/plugins/rspec
$ svn propget piston:remote-revision vendor/plugins/rspec_on_rails/
My blog on Ruby
More information about the rspec-users