Sha256: 1c30023bd557baf5243fdd9c986cda8ea163160c539be2f9752adb52be3767d5

Contents?: true

Size: 972 Bytes

Versions: 27

Compression:

Stored size: 972 Bytes

Contents

require 'carrierwave/test/matchers'

CarrierWave.configure do |config|
  config.storage = :file
  config.cache_dir = "spec/tmp/cache"
  config.root = File.join(Rails.root, 'spec', 'tmp')
end

module FixturedAsset
  def self.open(filename)
    File.new(self.path(filename))
  end

  def self.path(filename)
    File.join(File.dirname(__FILE__), '..', 'fixtures', 'assets', filename)
  end

  def self.duplicate(filename)
    dst = File.join(File.dirname(__FILE__), '..', 'tmp', filename)
    FileUtils.cp self.path(filename), dst
    dst
  end

  def self.reset!
    FileUtils.rm_rf(File.join(File.dirname(__FILE__), '..', 'tmp'))
    FileUtils.mkdir(File.join(File.dirname(__FILE__), '..', 'tmp'))
  end
end
FixturedAsset.reset!

def rack_asset(filename)
  file = FixturedAsset.open(filename)
  Rack::Test::UploadedFile.new(file)
end

def rack_theme_image(filename)
  file = FixturedAsset.open(File.join('..', 'images', filename))
  Rack::Test::UploadedFile.new(file)
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
locomotivecms-3.3.0 spec/support/carrierwave.rb
locomotivecms-3.3.0.rc3 spec/support/carrierwave.rb
locomotivecms-3.3.0.rc2 spec/support/carrierwave.rb
locomotivecms-3.1.2 spec/support/carrierwave.rb
locomotivecms-3.2.1 spec/support/carrierwave.rb
locomotivecms-3.3.0.rc1 spec/support/carrierwave.rb
locomotivecms-3.2.0 spec/support/carrierwave.rb
locomotivecms-3.2.0.rc2 spec/support/carrierwave.rb
locomotivecms-3.2.0.rc1 spec/support/carrierwave.rb
locomotivecms-3.1.1 spec/support/carrierwave.rb
locomotivecms-3.1.0 spec/support/carrierwave.rb
locomotivecms-3.1.0.rc3 spec/support/carrierwave.rb
locomotivecms-3.1.0.rc2 spec/support/carrierwave.rb
locomotivecms-3.1.0.rc1 spec/support/carrierwave.rb
locomotivecms-3.0.1 spec/support/carrierwave.rb
locomotivecms-3.0.0 spec/support/carrierwave.rb
locomotivecms-3.0.0.rc7 spec/support/carrierwave.rb
locomotivecms-3.0.0.rc6 spec/support/carrierwave.rb
locomotivecms-3.0.0.rc5 spec/support/carrierwave.rb
locomotivecms-3.0.0.rc4 spec/support/carrierwave.rb