[rspec-users] uploads with webrat in stories

Chong kee Tan lists at ruby-forum.com
Mon Nov 8 19:35:09 EST 2010


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.html

To summarize, syntax is
attach_file (field_locator, path, content_type = nil)

There is no need to call File.join or File.open, just specify the
relative path.

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list