protocol tests

master
Jordan Orelli 9 years ago
parent 2e6456f8e0
commit f6e1a61366

@ -75,6 +75,14 @@ module Bristlecode
expect(to_html(input)).to eq(output) expect(to_html(input)).to eq(output)
end end
it 'rejects bad url protocols' do
input = '[url=javascript:alert(1)]google.com[/url]'
expect { to_html(input) }.to raise_error
input = '[url=ftp://something.com/filez]google.com[/url]'
expect { to_html(input) }.to raise_error
end
it 'allows subtrees in <a> tags' do it 'allows subtrees in <a> tags' do
input = '[url=http://google.com]this is [b]the[/b] google[/url]' input = '[url=http://google.com]this is [b]the[/b] google[/url]'
output = '<a href="http://google.com" rel="nofollow">this is <b>the</b> google</a>' output = '<a href="http://google.com" rel="nofollow">this is <b>the</b> google</a>'

Loading…
Cancel
Save