summaryrefslogtreecommitdiff
path: root/spec/features/markdown_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/markdown_spec.rb')
-rw-r--r--spec/features/markdown_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb
index 7663d193354..cabccdacf87 100644
--- a/spec/features/markdown_spec.rb
+++ b/spec/features/markdown_spec.rb
@@ -173,10 +173,20 @@ describe 'GitLab Markdown', feature: true do
expect(link.attr('rel')).to include('noreferrer')
end
+ it 'adds _blank to target attribute for external links' do
+ link = doc.at_css('a:contains("Google")')
+ expect(link.attr('target')).to match('_blank')
+ end
+
it 'ignores internal link' do
link = doc.at_css('a:contains("GitLab Root")')
expect(link.attr('rel')).not_to match 'nofollow'
end
+
+ it 'does not set _blank to target attribute for internal links' do
+ link = doc.at_css('a:contains("GitLab Root")')
+ expect(link.attr('target')).not_to match '_blank'
+ end
end
end