')).to eq('
')
expect(sanitize('
test')).to eq('
test')
expect(sanitize('
test')).to eq('
test')
expect(sanitize('
test', external: true)).to eq('
test')
expect(sanitize('
)
')).to eq('
')
expect(sanitize('
)
')).to eq('')
expect(sanitize('
+ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-')).to eq(' +ADw-SCRIPT+AD4-alert(\'XSS\');+ADw-/SCRIPT+AD4-')
expect(sanitize('')).to eq('')
expect(sanitize("
XSS")).to eq('
XSS')
expect(sanitize("
XSS", external: true)).to eq('
XSS')
expect(sanitize('
XSS')).to eq('
XSS')
expect(sanitize('
XSS', external: true)).to eq('
XSS')
expect(sanitize('
')).to eq('X')
expect(sanitize('
CLICKME')).to eq('CLICKME')
expect(sanitize('
CLICKME')).to eq('CLICKME')
expect(sanitize('
CLICKME', external: true)).to eq('CLICKME')
expect(sanitize('

')).to eq('

')
expect(sanitize('
//)
')).to eq('
//)
')
expect(sanitize('
')).to eq('')
expect(sanitize('
')).to eq('
')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('
')).to eq('
')
expect(sanitize('XXX')).to eq('XXX')
expect(sanitize('XXX', external: true)).to eq('XXX')
expect(sanitize('')).to eq('')
end
it 'performs style cleanups' do
expect(sanitize('')).to eq('')
expect(sanitize('', external: true)).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('')).to eq('')
expect(sanitize('このアドレスへのメルマガを解除してください。
')).to eq('このアドレスへのメルマガを解除してください。
')
end
context 'when performing multiline style cleanup' do
let(:input) { <<~INPUT }
INPUT
let(:output) { <<~OUTPUT }
OUTPUT
it 'filters correctly' do
expect(sanitize(input)).to eq(output)
end
end
context 'when performing more multiline style cleanup' do
let(:input) { <<~INPUT }
123
abc
INPUT
let(:output) { <<~OUTPUT }