Spec for image upload and resizing

Hi,

I have a written spec for image upload model using paperclip plug-

in. The sample code looks like

Testing the upload image just not validation and saving to database,
its about the input image has got cropped or not if the input image
size exceeds the 600x600px. My input test images are saved in fixtures
folder.

But every time I run the test images are saving. Is there any way to
test my asset model?

Thanks in advance
Srinivas

On Mon, Jun 15, 2009 at 1:25 AM, srinu[email protected] wrote:

But every time I run the test images are saving. Is there any way to
test my asset model?

Well, it does have to save the processed image somewhere or you’re
not going to have anything to measure. My suggestion would be to
override Paperclip’s file path with a temporary directory (the
‘tempdir’ standard library can make one for you easily) in a
before(:all) or before(:each), and then delete the temporary directory
when you’re done.


Have Fun,
Steve E. ([email protected])
ESCAPE POD - The Science Fiction Podcast Magazine
http://www.escapepod.org

Well, thanks for the reply, as you suggested it is a better way to
override the file path.

Thanks
Srinivas