diff options
Diffstat (limited to 'spec/features/markdown_spec.rb')
-rw-r--r-- | spec/features/markdown_spec.rb | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb index d6954174660..ee1b3bf749d 100644 --- a/spec/features/markdown_spec.rb +++ b/spec/features/markdown_spec.rb @@ -149,7 +149,7 @@ describe 'GitLab Markdown' do it 'removes `rel` attribute from links' do body = get_section('sanitizationfilter') - expect(body).not_to have_selector('a[rel]') + expect(body).not_to have_selector('a[rel="bookmark"]') end it "removes `href` from `a` elements if it's fishy" do @@ -237,6 +237,18 @@ describe 'GitLab Markdown' do end end + describe 'ExternalLinkFilter' do + let(:links) { get_section('externallinkfilter').next_element } + + it 'adds nofollow to external link' do + expect(links.css('a').first.to_html).to match 'nofollow' + end + + it 'ignores internal link' do + expect(links.css('a').last.to_html).not_to match 'nofollow' + end + end + describe 'ReferenceFilter' do it 'handles references in headers' do header = @doc.at_css('#reference-filters-eg-1').parent |