Sha256: 65b0862c1cbdb9bdf07f55e467a3d4479b5db02bfa475517997535b04c65c875
Contents?: true
Size: 1.08 KB
Versions: 8
Compression:
Stored size: 1.08 KB
Contents
# see: https://til.codes/testing-carrierwave-file-uploads-with-rspec-and-factorygirl/ # REVIEW This apparently doesn't work... needs further investigation if Rails.env.test? || Rails.env.cucumber? # Setup Carrierwave to use local storage and disable file processing in test env CarrierWave.configure do |config| config.storage = :file config.enable_processing = false end # Separate out the upload folders for test environment. CarrierWave::Uploader::Base.descendants.each do |klass| next if klass.anonymous? klass.class_eval do def cache_dir "#{Binda::Engine.root}/spec/support/uploads/tmp" end def store_dir "#{Binda::Engine.root}/spec/support/uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}" end end end # Setting asset_host # (this line should stay outside the initial if statement) # REVIEW maybe the problem lies here... CarrierWave::Uploader::Base.descendants.each do |_| # Set the asset_host option for the carrierwave. config.asset_host = ActionController::Base.asset_host end end
Version data entries
8 entries across 8 versions & 1 rubygems