diff options
author | Robert Speicher <robert@gitlab.com> | 2016-04-21 23:49:41 +0300 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2016-04-21 23:49:41 +0300 |
commit | 1ea2408ba351646ac60c88136ed8b9acc58c6557 (patch) | |
tree | 9722a8ad3feddc1bcf653ac12ebdec6cb618b832 /spec/lib | |
parent | 0ae039d0a1da83d6e9b4cc4ffa20279ed9928a80 (diff) | |
parent | 72debd840cb76a5fc0929c0caeca179c39378680 (diff) |
Merge branch 'dev_issue_15331' into 'master'
Fixes window.opener bug
Adds `noreferrer` value to rel attribute for external links
REF: https://gitlab.com/gitlab-org/gitlab-ce/issues/15331
See merge request !1953
Diffstat (limited to 'spec/lib')
-rw-r--r-- | spec/lib/banzai/filter/external_link_filter_spec.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/spec/lib/banzai/filter/external_link_filter_spec.rb b/spec/lib/banzai/filter/external_link_filter_spec.rb index e3a8e15330e..f4c5c621bd0 100644 --- a/spec/lib/banzai/filter/external_link_filter_spec.rb +++ b/spec/lib/banzai/filter/external_link_filter_spec.rb @@ -24,6 +24,14 @@ describe Banzai::Filter::ExternalLinkFilter, lib: true do doc = filter(act) expect(doc.at_css('a')).to have_attribute('rel') - expect(doc.at_css('a')['rel']).to eq 'nofollow' + expect(doc.at_css('a')['rel']).to include 'nofollow' + end + + it 'adds rel="noreferrer" to external links' do + act = %q(<a href="https://google.com/">Google</a>) + doc = filter(act) + + expect(doc.at_css('a')).to have_attribute('rel') + expect(doc.at_css('a')['rel']).to include 'noreferrer' end end |