Sha256: 7a03732e79d18659a0f91f12bdba8358d4b1cc8a5d947be70d318ad2e0e6e3f3
Contents?: true
Size: 537 Bytes
Versions: 27
Compression:
Stored size: 537 Bytes
Contents
require 'spec_helper' describe Betterdocs::Sanitizer do let :sanitizer do described_class.new do |text| text.gsub('<evil>', '') end end let :text do '<foo><evil><bar>' end it 'removes evil tags from strings' do expect(sanitizer.sanitize(text)).to eq '<foo><bar>' end it 'ignores other JSON data types' do expect(sanitizer.sanitize(nil)).to eq nil end it 'calls #to_s on the remaining types and sanitizes' do expect(sanitizer.sanitize(double(to_s: text))).to eq '<foo><bar>' end end
Version data entries
27 entries across 27 versions & 1 rubygems