Is it possible to make attachment_fu upload 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?

Or just mock them.

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

Thanks

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

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