diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/markdown_spec.rb | 4 | ||||
-rw-r--r-- | spec/lib/gitlab/markdown/autolink_filter_spec.rb | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb index 9db1a0a2418..3528200e12b 100644 --- a/spec/features/markdown_spec.rb +++ b/spec/features/markdown_spec.rb @@ -207,11 +207,9 @@ describe 'GitLab Markdown' do expect(item(5).children.first['href']).to eq 'irc://irc.freenode.net/git' end - # TODO (rspeicher): Do we really want this? it 'autolinks short, invalid URLs' do - skip 'rspeicher: Pending decision' expect(item(6).children.first.name).to eq 'a' - expect(item(6).children.first['href']).to eq 'http://foo' + expect(item(6).children.first['href']).to eq 'http://localhost:3000' end %w(code a kbd).each do |elem| diff --git a/spec/lib/gitlab/markdown/autolink_filter_spec.rb b/spec/lib/gitlab/markdown/autolink_filter_spec.rb index 83fee123330..0bbdc11a979 100644 --- a/spec/lib/gitlab/markdown/autolink_filter_spec.rb +++ b/spec/lib/gitlab/markdown/autolink_filter_spec.rb @@ -41,6 +41,14 @@ module Gitlab::Markdown expect(doc.at_css('a')['href']).to eq link end + it 'autolinks short URLs' do + link = 'http://localhost:3000/' + doc = filter("See #{link}") + + expect(doc.at_css('a').text).to eq link + expect(doc.at_css('a')['href']).to eq link + end + it 'accepts link_attr options' do doc = filter("See #{link}", link_attr: {class: 'custom'}) |