Sha256: dcc05dfd6c48f8367446456ac18eb839f35350ce405485f4bf6273d97e9c2ad6
Contents?: true
Size: 1.1 KB
Versions: 7
Compression:
Stored size: 1.1 KB
Contents
require 'spec_helper' describe "Uploading" do with_tmp_spec_dir with_mongoid with_files before :all do class TheImageUploader < Models::FileUploader end class ThePost include Mongoid::Document field :name, type: String, default: "" validates_uniqueness_of :name mount_uploader :image, TheImageUploader end end after(:all){remove_constants :ThePost, :TheImageUploader} it "should preserve spaces and unicode characters in filename" do File.open "#{spec_dir}/файл с пробелами.txt" do |f| ship = ThePost.new image: f ship.image.url.should =~ /\/файл с пробелами\.txt/ ship.image.filename =~ /файл с пробелами\.txt/ ship.image.path =~ /\/файл с пробелами\.txt/ # ship.smart_url.should =~ /files\/file with spaces\/file with spaces\.txt\?\d/ # f.smart_url.should =~ /files\/data\/ship\?\d+/ # f.smart_url(:icon).should =~ /images\/mime\/dat_icon\.png/ # f.smart_url(:thumb).should =~ /images\/mime\/dat_thumb\.png/ end end end
Version data entries
7 entries across 7 versions & 1 rubygems