[rspec-users] Testing file attachment with Paperclip
nick at deadorange.com
Sat Jan 17 10:12:09 EST 2009
On 2009-01-17, at 05:10, Fernando Perez wrote:
>> 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
>> that the file isn't saved [to disk, for me]:
>> I hope that helps!
> 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.
I'm glad you got it sorted out =)
More information about the rspec-users