Re: [rspec-users] uploads with webrat in stories

2010-11-08 Thread Chong kee Tan
In case there are other people trying to do the same thing, webrat's implementation of attach_file has changed somewhat. See this URL for the current method to attach a file in your multipart form: http://gitrdoc.com/rdoc/brynary/webrat/273e8c541a82ddacf91f4f68ab6166c16ffdc9c5/classes/Webrat/Scope

Re: [rspec-users] uploads with webrat in stories

2009-09-02 Thread Enrico Hartung
This topic might be a little bit old, but since I run into this issue recently here's the solution: Due to a lack of multipart form support for integration tests in Action Pack Webrat's attach_file does not work with Rails 2.0.2. I posted a workaround on our blog: http://devblog.imedo.de/2009/

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Jonathan Linowes
On Aug 29, 2008, at 1:58 PM, Christopher Bailey wrote: I too would suggest trying attaches_file. I use it in a few different stories I have, and it works fine for me. I don't believe I'm doing anything nonstandard. Here's the basics of what yep, works for me :) thx__

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Joseph Wilk
When Webrat matches 'Exception caught' on the get/post response body it tries to save the response body down as a html file and then invokes opening it in a browser (I believe the opening only works on OS X though I've never tested it in another os). This is a very useful feature unless you get

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Jonathan Linowes
On Aug 29, 2008, at 1:19 PM, Jonathan Linowes wrote: i am trying that too, but at this point in my story i dont actually have the current record object to generate the form action path. How would i extract the :action = path from the in the current response.body ? got it #assuming on

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Christopher Bailey
I too would suggest trying attaches_file. I use it in a few different stories I have, and it works fine for me. I don't believe I'm doing anything nonstandard. Here's the basics of what one of mine looks like (stripped out some fills_in's, etc. to declutter the example): When "create a new hot

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Jonathan Linowes
On Aug 29, 2008, at 12:52 PM, Ben Mabey wrote: Jonathan Linowes wrote: I've read through the messages on this list, and have file upload specs working in my model and controller tests, using :file => ActionController::TestUploadedFile.new(filepath) But its not working in stories using webrat.

Re: [rspec-users] uploads with webrat in stories

2008-08-29 Thread Ben Mabey
Jonathan Linowes wrote: > I've read through the messages on this list, and have file upload > specs working in my model and controller tests, using :file => > ActionController::TestUploadedFile.new(filepath) > > But its not working in stories using webrat. I've tried > > fills_in "foo[file]", :

[rspec-users] uploads with webrat in stories

2008-08-29 Thread Jonathan Linowes
I've read through the messages on this list, and have file upload specs working in my model and controller tests, using :file => ActionController::TestUploadedFile.new(filepath) But its not working in stories using webrat. I've tried fills_in "foo[file]", :with => filepath and fills