diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-22 13:04:46 +0000 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2015-04-22 13:04:46 +0000 |
commit | 0e0325ee993eee2e9aac04186c46a0fde1d726a3 (patch) | |
tree | ea7a5778f60d46b4f7b5b7d795c7ebf36dbef58b /spec | |
parent | 45025fecf2c0d3e060d30f860916668621dc6515 (diff) | |
parent | c917b26f410fba6757ccf10f8b1c357ea3f2ab15 (diff) | |
download | gitlab-ce-0e0325ee993eee2e9aac04186c46a0fde1d726a3.tar.gz |
Merge branch 'rs-issue-2257' into 'master'
Recover from URI::Error
`URI::Error` is the base class for all URI errors.
Fixes #2257 and #2260
See merge request !1789
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 015a66f7fa0..d4cf6540080 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -249,6 +249,16 @@ describe ApplicationHelper do expect(link_to('Example', 'http://example.foo/bar')). to eq '<a href="http://example.foo/bar">Example</a>' end + + it 'should not raise an error when given a bad URI' do + expect { link_to('default', 'if real=1 RANDOM; if real>1 IDLHS; if real>500 LHS') }. + not_to raise_error + end + + it 'should not raise an error when given a bad mailto URL' do + expect { link_to('email', 'mailto://foo.bar@example.es?subject=Subject%20Line') }. + not_to raise_error + end end describe 'markup_render' do |