Sha256: d628002d7a7598bbc019fd146459ebc357577759f0b107faa76b96d955e0a678
Contents?: true
Size: 765 Bytes
Versions: 35
Compression:
Stored size: 765 Bytes
Contents
require 'spec_helper' describe Bergamasco::Sanitize do subject { Bergamasco::Sanitize } it 'should remove a tags' do text = "In 1998 <strong>Tim Berners-Lee</strong> coined the term <a href=\"https://www.w3.org/Provider/Style/URI\">cool URIs</a>" content = subject.sanitize(text) expect(content).to eq("In 1998 <strong>Tim Berners-Lee</strong> coined the term cool URIs") end it 'should only keep specific tags' do text = "In 1998 <strong>Tim Berners-Lee</strong> coined the term <a href=\"https://www.w3.org/Provider/Style/URI\">cool URIs</a>" content = subject.sanitize(text, tags: ["a"]) expect(content).to eq("In 1998 Tim Berners-Lee coined the term <a href=\"https://www.w3.org/Provider/Style/URI\">cool URIs</a>") end end
Version data entries
35 entries across 35 versions & 1 rubygems