[rspec-users] Testing file attachment with Paperclip

Fernando Perez lists at ruby-forum.com
Sat Jan 17 05:10:59 EST 2009


> G'day again Fernando. IIRC, Paperclip's #save_attached_files is what
> takes care of saving the attachment to disk, uploading it to S3, etc.
> Here's a small gist that tests the allowance of JPG files, and ensures
> that the file isn't saved [to disk, for me]:
> http://gist.github.com/48264
> 
> I hope that helps!
> Nick

Hi Nick,

Don't ask me why, but this morning I tried once again to simply do: 
product.image = File.new('path_to_image.png'), and it worked perfectly 
as expected and passed validations and whatever.
-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list