Sha256: 2d934e6889df729c4b59ae9dc46b4fed0ad7934a4bd4126b858bd9aa3aedebb5

Contents?: true

Size: 430 Bytes

Versions: 31

Compression:

Stored size: 430 Bytes

Contents

# encoding: utf-8
require 'spec_helper'

describe Paperclip::FilenameCleaner do
  it 'converts invalid characters to underscores' do
    cleaner = Paperclip::FilenameCleaner.new(/[aeiou]/)
    expect(cleaner.call("baseball")).to eq "b_s_b_ll"
  end

  it 'does not convert anything if the character regex is nil' do
    cleaner = Paperclip::FilenameCleaner.new(nil)
    expect(cleaner.call("baseball")).to eq "baseball"
  end
end

Version data entries

31 entries across 29 versions & 6 rubygems

Version Path
kt-paperclip-5.4.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-4.4.0 spec/paperclip/filename_cleaner_spec.rb
paperclip-6.0.0 spec/paperclip/filename_cleaner_spec.rb
paperclip-5.3.0 spec/paperclip/filename_cleaner_spec.rb
paperclip-5.2.1 spec/paperclip/filename_cleaner_spec.rb
paperclip-5.2.0 spec/paperclip/filename_cleaner_spec.rb
enju_leaf-1.2.1 vendor/bundle/ruby/2.3/gems/paperclip-5.1.0/spec/paperclip/filename_cleaner_spec.rb
paperclip-5.1.0 spec/paperclip/filename_cleaner_spec.rb
paperclip-5.0.0 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.7 spec/paperclip/filename_cleaner_spec.rb
paperclip_jk-5.0.0.beta2 spec/paperclip/filename_cleaner_spec.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/paperclip-4.3.6/spec/paperclip/filename_cleaner_spec.rb
paperclip-5.0.0.beta2 spec/paperclip/filename_cleaner_spec.rb
paperclip-5.0.0.beta1 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.6 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.5 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.4 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.3 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.2 spec/paperclip/filename_cleaner_spec.rb
paperclip-4.3.1 spec/paperclip/filename_cleaner_spec.rb