Is it possible to make attachment_fu to use :file_system for storage during tests?

I’m using Attachment_fu for a model that has 3 attachment fields with s3
for storage.

Unit testing this model is very slow. This made me think if there is a
way to switch between storage types during testing and
development/production?

Could you please be more specific or provide an example if possible?

Thanks

On Fri, Mar 8, 2013 at 7:54 PM, Arman M. [email protected] wrote:

I’m using Attachment_fu for a model that has 3 attachment fields with s3
for storage.

Unit testing this model is very slow. This made me think if there is a
way to switch between storage types during testing and
development/production?

Or just mock them.

On Saturday, March 9, 2013 1:54:38 AM UTC, Ruby-Forum.com User wrote:

I’m using Attachment_fu for a model that has 3 attachment fields with s3
for storage.

Unit testing this model is very slow. This made me think if there is a
way to switch between storage types during testing and
development/production?

Attachment_fu is a little old school, but there’s no reason you couldn’t
do
something like

has_attachment :storage => (Rails.env.production? ? :s3 : 

:file_system)

to use s3 for production and filesystem for everything else

Fred

On Fri, Mar 8, 2013 at 10:24 PM, Roman M. [email protected]
wrote:

Could you please be more specific or provide an example if possible?

Read up on rspec mocks in the RSpec book, and there are several
examples around the net.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs