Sha256: 5ffeb89e0afdb04a865223832a276de33e3c7011eeed69f8648b8a8788f583f8
Contents?: true
Size: 1.42 KB
Versions: 49
Compression:
Stored size: 1.42 KB
Contents
require 'spec_helper' describe "Uploads" do if Settings.file_uploads_engine != :carrierwave pending "paperclip not detected, skipped. To run use UPLOADS=carrierwave rspec" else before :each do f = "#{File.dirname(__FILE__)}/../uploads/1024x768.gif" if File.file?(f) File.unlink(f) end end it 'supports file kind' do Settings.set('file', File.open("#{File.dirname(__FILE__)}/support/1024x768.gif"), kind: 'file') # because we're not inside Rails Settings.get(:file).file.root = '/' expect(Settings.get(:file).file.file.file).to eq "#{File.dirname(__FILE__).gsub('/spec', '/')}uploads/1024x768.gif" expect(File.exists?(Settings.root_file_path.join("uploads/1024x768.gif"))).to be_truthy end it 'supports image kind' do Settings.set('file', File.open("#{File.dirname(__FILE__)}/support/1024x768.gif"), kind: 'image') # because we're not inside Rails Settings.get(:file).file.root = '/' expect(Settings.get(:file).file.file.file).to eq "#{File.dirname(__FILE__).gsub('/spec', '/')}uploads/1024x768.gif" expect(File.exists?(Settings.root_file_path.join("uploads/1024x768.gif"))).to be_truthy end it 'supports defaults' do Settings.apply_defaults!(File.join(File.dirname(__FILE__), 'support/defaults_w_file.yml')) expect(File.exists?(Settings.root_file_path.join("uploads/1024x768.gif"))).to be_truthy end end end
Version data entries
49 entries across 49 versions & 3 rubygems