Stubbing out s3 in tests

12 views
Skip to first unread message

Trevor Turk

unread,
Jan 16, 2009, 5:19:54 PM1/16/09
to Paperclip Plugin
I'm using Mocha to stub out calls to s3 in my regular tests like so:

Photo.any_instance.stubs(:save_attached_files).returns(true)

In my case, I have a Photo model with an "image" attachment.

This seems to work well enough. I also have real tests that I run
manually with a rake task.

I'm wondering if anyone has thoughts on this approach. I also hope
this might come in handy for other people trying to do the same thing.
Google wasn't too kind in my search for an easy solution :)

- Trevor
Reply all
Reply to author
Forward
0 new messages