Sha256: e9c6b2759826308c68e48ad9b2fa4128f827449ab6b778d9ce64816e18ce444e
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
# encoding: utf-8 require 'spec_helper' describe ActiveCleaner::Utf8mb3Cleaner do let(:cleaner) { ActiveCleaner::Utf8mb3Cleaner.new(:title) } describe "#clean_value" do it "doesn't touch legit value" do expect(cleaner.clean_value("A good title!")).to eq("A good title!") end it "cleans emoticons" do emoticons = "๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ก๐ข๐ฃ๐ค๐ฅ๐ฆ๐ง๐จ๐ฉ๐ช๐ซ๐ฌ๐ญ๐ฎ๐ฏ๐ฐ๐ฑ๐ฒ๐ณ๐ด๐ต๐ถ๐ท๐ธ๐น๐บ๐ป๐ผ๐ฝ๐พ๐ฟ๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐" expect(cleaner.clean_value("A good #{emoticons} title!")).to eq("A good title!") end it "kepts accentued chars" do expect(cleaner.clean_value("L'Inouรฏ Goรปter ร Manger.")).to eq("L'Inouรฏ Goรปter ร Manger.") end it "kepts japanese chars" do expect(cleaner.clean_value("ginkล is written as ้่ก")).to eq("ginkล is written as ้่ก") end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activecleaner-0.3.0 | spec/lib/active_cleaner/utf8mb4_cleaner_spec.rb |