Stubbing out s3 in tests

已查看 11 次
跳至第一个未读帖子

Trevor Turk

未读,
2009年1月16日 17:19:542009/1/16
收件人 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
回复全部
回复作者
转发
0 个新帖子