Created
April 3, 2012 22:19
-
-
Save databyte/2295881 to your computer and use it in GitHub Desktop.
CarrierWave Uploader spec stubbing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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