Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CarrierWave Uploader spec stubbing
CarrierWave::Uploader::Base.descendants.each do |klass|
next if klass.anonymous?
klass.class_eval do
def cache_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/tmp"
end
def store_dir
"#{Rails.root}/public/system/test/#{Process.pid.to_s}/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
end
def url
super
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.