Skip to content

Instantly share code, notes, and snippets.

@semipermeable
Created October 31, 2011 19:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save semipermeable/1328565 to your computer and use it in GitHub Desktop.
Save semipermeable/1328565 to your computer and use it in GitHub Desktop.
Tddium CarrierWave configuration
# config/initializers/carrierwave.rb
CarrierWave.configure do |config|
if Rails.env.production?
# production setup stuff
elsif Rails.env.test?
if ENV['TDDIUM']
config.storage = :file
config.root = Dir.tmpdir
config.cache_dir = "carrierwave"
else
config.storage = :file
end
else
# other config
end
end
@mockdeep
Copy link

@semipermeable any suggestions for using this with Capybara specs? When I try to set storage to :file for feature specs, I get No route matches errors for images that are uploaded. We set it to store in public/tmp to get around this, but then it doesn't work consistently on Tddium.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment