Sha256: 36bc64fd2b97a36c26440b3cd0eabd9bcdbf4f8b23dabb9a102155162e2b1622

Contents?: true

Size: 412 Bytes

Versions: 14

Compression:

Stored size: 412 Bytes

Contents

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

14 entries across 14 versions & 1 rubygems

Version Path
kt-paperclip-7.2.2 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.2.1 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.2.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.4.2 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.1.1 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.1.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.0.1 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-7.0.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.4.1 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.4.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.3.0 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.2.2 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.2.1 spec/paperclip/filename_cleaner_spec.rb
kt-paperclip-6.2.0 spec/paperclip/filename_cleaner_spec.rb