mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-01-31 12:19:08 +01:00
Add test cases for invalid URIs in Markdown
This commit is contained in:
parent
13c397fe73
commit
0a530bfd63
1 changed files with 8 additions and 0 deletions
|
@ -62,6 +62,14 @@ describe MarkdownHelper, :type => :helper do
|
||||||
it 'should not process any markup aside of links' do
|
it 'should not process any markup aside of links' do
|
||||||
expect(question_markdown('**your account has been disabled**, [click here to enable it again](https://evil.example.com)')). to eq('<p>**your account has been disabled**, [click here to enable it again](<a href="/linkfilter?url=https%3A%2F%2Fevil.example.com" target="_blank" rel="nofollow">https://evil.example.com</a>)</p>')
|
expect(question_markdown('**your account has been disabled**, [click here to enable it again](https://evil.example.com)')). to eq('<p>**your account has been disabled**, [click here to enable it again](<a href="/linkfilter?url=https%3A%2F%2Fevil.example.com" target="_blank" rel="nofollow">https://evil.example.com</a>)</p>')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'should not raise an exception if an invalid link is processed' do
|
||||||
|
expect{ question_markdown('https://example.com/example.質問') }.not_to raise_error
|
||||||
|
end
|
||||||
|
|
||||||
|
it 'should not process invalid links' do
|
||||||
|
expect(question_markdown('https://example.com/example.質問')).to eq('<p>https://example.com/example.質問</p>')
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#raw_markdown' do
|
describe '#raw_markdown' do
|
||||||
|
|
Loading…
Reference in a new issue